nophead / NopSCADlib

Library of parts modelled in OpenSCAD and a framework for making projects
GNU General Public License v3.0
1.14k stars 154 forks source link

[Feature proposal] Add 2nd arg to geared_stepper() allowing to turn its motor shaft #277

Closed Hermann-SW closed 2 months ago

Hermann-SW commented 2 months ago

Two line change only in "vitamins/geared_stepper.scad":

 gearbox_colour = "#FFF7EE";

-module geared_stepper(type) { //! Draw the specified geared stepper
+module geared_stepper(type, ang) { //! Draw the specified geared stepper
     vitamin(str("geared_stepper(", type[0], "): Geared stepper - ", type[1]));

     radius = gs_diameter(type) / 2;
@@ -128,6 +128,7 @@ module geared_stepper(type) { //! Draw the specified geared stepper
         color(two_flats ? brass : gearbox_colour) {
             d = gs_shaft_d(type);
             h = gs_shaft_length(type);
+          rotate([0,0,ang])
             linear_extrude(h)

I once created a PT camera from two 28BYJ_48 motors and a Raspberry v1 camera with 4 drops of superglue:

Details on the animation below making use of this new feature in this forum posting: https://forums.raspberrypi.com/viewtopic.php?p=2233179#p2233179

nophead commented 2 months ago

Great minimalist mechanical design!

I added a parameter called angle and gave it a default of 0 for backwards compatibility. It also rotates the whole shaft, not just the flat part: ad74378e7e85b3f0ba5d8e0cbd7aa2da1eb05362