From 04e94a859aa0d21f840c992b487a901f096790a4 Mon Sep 17 00:00:00 2001 From: Chris Palmer Date: Tue, 1 Feb 2022 23:25:04 +0000 Subject: [PATCH] Added earth_rot parameter to NEMA_screws(). --- readme.md | 2 +- vitamins/stepper_motor.scad | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/readme.md b/readme.md index 05d5677..b5f5362 100644 --- a/readme.md +++ b/readme.md @@ -3876,7 +3876,7 @@ NEMA stepper motor model. | `NEMA(type, shaft_angle = 0, jst_connector = false)` | Draw specified NEMA stepper motor | | `NEMA_outline(type)` | 2D outline | | `NEMA_screw_positions(type, n = 4)` | Positions children at the screw holes | -| `NEMA_screws(type, screw, n = 4, screw_length = 8, earth = undef)` | Place screws and optional earth tag | +| `NEMA_screws(type, screw, n = 4, screw_length = 8, earth = undef, earth_rot = undef)` | Place screws and optional earth tag | ![stepper_motors](tests/png/stepper_motors.png) diff --git a/vitamins/stepper_motor.scad b/vitamins/stepper_motor.scad index fb7a6c6..08b45d6 100644 --- a/vitamins/stepper_motor.scad +++ b/vitamins/stepper_motor.scad @@ -205,12 +205,12 @@ module NEMA_screw_positions(type, n = 4) { //! Positions children at the screw h children(); } -module NEMA_screws(type, screw, n = 4, screw_length = 8, earth = undef) //! Place screws and optional earth tag +module NEMA_screws(type, screw, n = 4, screw_length = 8, earth = undef, earth_rot = undef) //! Place screws and optional earth tag NEMA_screw_positions(type, n) if($i != earth) screw_and_washer(screw, screw_length, true); else - rotate($i > 1 ? 180 : 0) + rotate(is_undef(earth_rot) ? $i > 1 ? 180 : 0 : earth_rot) ring_terminal(M3_ringterm) star_washer(screw_washer(screw)) screw(screw, screw_length);