mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-08-11 18:04:02 +02:00
Can now specify a rotation angle for a geared_stepper's shaft.
This commit is contained in:
@@ -1459,7 +1459,7 @@ Geared tin can steppers
|
|||||||
### Modules
|
### Modules
|
||||||
| Module | Description |
|
| Module | Description |
|
||||||
|:--- |:--- |
|
|:--- |:--- |
|
||||||
| `geared_stepper(type)` | Draw the specified geared stepper |
|
| `geared_stepper(type, angle = 0)` | Draw the specified geared stepper with optional shaft angle. |
|
||||||
| `geared_stepper_screw_positions(type)` | Place children at the screw positions |
|
| `geared_stepper_screw_positions(type)` | Place children at the screw positions |
|
||||||
|
|
||||||

|

|
||||||
|
@@ -52,7 +52,7 @@ module geared_stepper_screw_positions(type) //! Place children at the screw posi
|
|||||||
motor_colour = "#9BA2AC";
|
motor_colour = "#9BA2AC";
|
||||||
gearbox_colour = "#FFF7EE";
|
gearbox_colour = "#FFF7EE";
|
||||||
|
|
||||||
module geared_stepper(type) { //! Draw the specified geared stepper
|
module geared_stepper(type, angle = 0) { //! Draw the specified geared stepper with optional shaft angle.
|
||||||
vitamin(str("geared_stepper(", type[0], "): Geared stepper - ", type[1]));
|
vitamin(str("geared_stepper(", type[0], "): Geared stepper - ", type[1]));
|
||||||
|
|
||||||
radius = gs_diameter(type) / 2;
|
radius = gs_diameter(type) / 2;
|
||||||
@@ -125,19 +125,20 @@ module geared_stepper(type) { //! Draw the specified geared stepper
|
|||||||
f = gs_shaft_flat(type);
|
f = gs_shaft_flat(type);
|
||||||
two_flats = f < 0;
|
two_flats = f < 0;
|
||||||
vflip()
|
vflip()
|
||||||
color(two_flats ? brass : gearbox_colour) {
|
rotate(angle)
|
||||||
d = gs_shaft_d(type);
|
color(two_flats ? brass : gearbox_colour) {
|
||||||
h = gs_shaft_length(type);
|
d = gs_shaft_d(type);
|
||||||
linear_extrude(h)
|
h = gs_shaft_length(type);
|
||||||
intersection() {
|
linear_extrude(h)
|
||||||
circle(d = d);
|
intersection() {
|
||||||
|
circle(d = d);
|
||||||
|
|
||||||
translate([0, two_flats ? 0 : (f - d) / 2])
|
translate([0, two_flats ? 0 : (f - d) / 2])
|
||||||
square([d + 1, abs(f)], center = true);
|
square([d + 1, abs(f)], center = true);
|
||||||
}
|
}
|
||||||
|
|
||||||
cylinder(d = d, h = h - gs_flat_length(type));
|
cylinder(d = d, h = h - gs_flat_length(type));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wire block
|
// Wire block
|
||||||
color(bulge_z ? "white" : "skyblue") {
|
color(bulge_z ? "white" : "skyblue") {
|
||||||
|
Reference in New Issue
Block a user