mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-08-31 18:11:45 +02:00
Renamed align to anchor.
This commit is contained in:
@@ -129,10 +129,10 @@ function nema_motor_screw_depth(size) = lookup(size, [
|
||||
// shaft = Shaft diameter. Default: 5mm
|
||||
// shaft_len = Length of shaft protruding out the top of the stepper motor. Default: 20mm
|
||||
// orient = Orientation of the stepper. Use the `ORIENT_` constants from `constants.scad`. Default: `ORIENT_Z`.
|
||||
// align = Alignment of the stepper. Use the constants from `constants.scad`. Default: `DOWN`.
|
||||
// anchor = Alignment of the stepper. Use the constants from `constants.scad`. Default: `DOWN`.
|
||||
// Example:
|
||||
// nema11_stepper();
|
||||
module nema11_stepper(h=24, shaft=5, shaft_len=20, orient=ORIENT_Z, align=DOWN)
|
||||
module nema11_stepper(h=24, shaft=5, shaft_len=20, orient=ORIENT_Z, anchor=DOWN)
|
||||
{
|
||||
size = 11;
|
||||
motor_width = nema_motor_width(size);
|
||||
@@ -142,11 +142,11 @@ module nema11_stepper(h=24, shaft=5, shaft_len=20, orient=ORIENT_Z, align=DOWN)
|
||||
screw_size = nema_motor_screw_size(size);
|
||||
screw_depth = nema_motor_screw_depth(size);
|
||||
|
||||
orient_and_align([motor_width, motor_width, h], orient, align, orig_align=DOWN, chain=true) {
|
||||
orient_and_anchor([motor_width, motor_width, h], orient, anchor, orig_anchor=DOWN, chain=true) {
|
||||
union() {
|
||||
difference() {
|
||||
color([0.4, 0.4, 0.4])
|
||||
cuboid(size=[motor_width, motor_width, h], chamfer=2, edges=EDGES_Z_ALL, align=DOWN);
|
||||
cuboid(size=[motor_width, motor_width, h], chamfer=2, edges=EDGES_Z_ALL, anchor=DOWN);
|
||||
color("silver")
|
||||
xspread(screw_spacing)
|
||||
yspread(screw_spacing)
|
||||
@@ -173,10 +173,10 @@ module nema11_stepper(h=24, shaft=5, shaft_len=20, orient=ORIENT_Z, align=DOWN)
|
||||
// shaft = Shaft diameter. Default: 5mm
|
||||
// shaft_len = Length of shaft protruding out the top of the stepper motor. Default: 24mm
|
||||
// orient = Orientation of the stepper. Use the `ORIENT_` constants from `constants.scad`. Default: `ORIENT_Z`.
|
||||
// align = Alignment of the stepper. Use the constants from `constants.scad`. Default: `DOWN`.
|
||||
// anchor = Alignment of the stepper. Use the constants from `constants.scad`. Default: `DOWN`.
|
||||
// Example:
|
||||
// nema14_stepper();
|
||||
module nema14_stepper(h=24, shaft=5, shaft_len=24, orient=ORIENT_Z, align=DOWN)
|
||||
module nema14_stepper(h=24, shaft=5, shaft_len=24, orient=ORIENT_Z, anchor=DOWN)
|
||||
{
|
||||
size = 14;
|
||||
motor_width = nema_motor_width(size);
|
||||
@@ -186,11 +186,11 @@ module nema14_stepper(h=24, shaft=5, shaft_len=24, orient=ORIENT_Z, align=DOWN)
|
||||
screw_size = nema_motor_screw_size(size);
|
||||
screw_depth = nema_motor_screw_depth(size);
|
||||
|
||||
orient_and_align([motor_width, motor_width, h], orient, align, orig_align=DOWN, chain=true) {
|
||||
orient_and_anchor([motor_width, motor_width, h], orient, anchor, orig_anchor=DOWN, chain=true) {
|
||||
union() {
|
||||
difference() {
|
||||
color([0.4, 0.4, 0.4])
|
||||
cuboid(size=[motor_width, motor_width, h], chamfer=2, edges=EDGES_Z_ALL, align=DOWN);
|
||||
cuboid(size=[motor_width, motor_width, h], chamfer=2, edges=EDGES_Z_ALL, anchor=DOWN);
|
||||
color("silver")
|
||||
xspread(screw_spacing)
|
||||
yspread(screw_spacing)
|
||||
@@ -202,7 +202,7 @@ module nema14_stepper(h=24, shaft=5, shaft_len=24, orient=ORIENT_Z, align=DOWN)
|
||||
cyl(h=plinth_height*3, d=shaft+0.75);
|
||||
}
|
||||
}
|
||||
color("silver") cyl(h=shaft_len, d=shaft, align=UP, $fn=max(12,segs(shaft/2)));
|
||||
color("silver") cyl(h=shaft_len, d=shaft, anchor=UP, $fn=max(12,segs(shaft/2)));
|
||||
}
|
||||
children();
|
||||
}
|
||||
@@ -217,10 +217,10 @@ module nema14_stepper(h=24, shaft=5, shaft_len=24, orient=ORIENT_Z, align=DOWN)
|
||||
// shaft = Shaft diameter. Default: 5mm
|
||||
// shaft_len = Length of shaft protruding out the top of the stepper motor. Default: 20mm
|
||||
// orient = Orientation of the stepper. Use the `ORIENT_` constants from `constants.scad`. Default: `ORIENT_Z`.
|
||||
// align = Alignment of the stepper. Use the constants from `constants.scad`. Default: `DOWN`.
|
||||
// anchor = Alignment of the stepper. Use the constants from `constants.scad`. Default: `DOWN`.
|
||||
// Example:
|
||||
// nema17_stepper();
|
||||
module nema17_stepper(h=34, shaft=5, shaft_len=20, orient=ORIENT_Z, align=DOWN)
|
||||
module nema17_stepper(h=34, shaft=5, shaft_len=20, orient=ORIENT_Z, anchor=DOWN)
|
||||
{
|
||||
size = 17;
|
||||
motor_width = nema_motor_width(size);
|
||||
@@ -230,11 +230,11 @@ module nema17_stepper(h=34, shaft=5, shaft_len=20, orient=ORIENT_Z, align=DOWN)
|
||||
screw_size = nema_motor_screw_size(size);
|
||||
screw_depth = nema_motor_screw_depth(size);
|
||||
|
||||
orient_and_align([motor_width, motor_width, h], orient, align, orig_align=DOWN, chain=true) {
|
||||
orient_and_anchor([motor_width, motor_width, h], orient, anchor, orig_anchor=DOWN, chain=true) {
|
||||
union() {
|
||||
difference() {
|
||||
color([0.4, 0.4, 0.4])
|
||||
cuboid([motor_width, motor_width, h], chamfer=2, edges=EDGES_Z_ALL, align=DOWN);
|
||||
cuboid([motor_width, motor_width, h], chamfer=2, edges=EDGES_Z_ALL, anchor=DOWN);
|
||||
color("silver")
|
||||
xspread(screw_spacing)
|
||||
yspread(screw_spacing)
|
||||
@@ -280,10 +280,10 @@ module nema17_stepper(h=34, shaft=5, shaft_len=20, orient=ORIENT_Z, align=DOWN)
|
||||
// shaft = Shaft diameter. Default: 6.35mm
|
||||
// shaft_len = Length of shaft protruding out the top of the stepper motor. Default: 25mm
|
||||
// orient = Orientation of the stepper. Use the `ORIENT_` constants from `constants.scad`. Default: `ORIENT_Z`.
|
||||
// align = Alignment of the stepper. Use the constants from `constants.scad`. Default: `DOWN`.
|
||||
// anchor = Alignment of the stepper. Use the constants from `constants.scad`. Default: `DOWN`.
|
||||
// Example:
|
||||
// nema23_stepper();
|
||||
module nema23_stepper(h=50, shaft=6.35, shaft_len=25, orient=ORIENT_Z, align=DOWN)
|
||||
module nema23_stepper(h=50, shaft=6.35, shaft_len=25, orient=ORIENT_Z, anchor=DOWN)
|
||||
{
|
||||
size = 23;
|
||||
motor_width = nema_motor_width(size);
|
||||
@@ -294,11 +294,11 @@ module nema23_stepper(h=50, shaft=6.35, shaft_len=25, orient=ORIENT_Z, align=DOW
|
||||
screw_depth = nema_motor_screw_depth(size);
|
||||
|
||||
screw_inset = motor_width - screw_spacing + 1;
|
||||
orient_and_align([motor_width, motor_width, h], orient, align, orig_align=DOWN, chain=true) {
|
||||
orient_and_anchor([motor_width, motor_width, h], orient, anchor, orig_anchor=DOWN, chain=true) {
|
||||
difference() {
|
||||
union() {
|
||||
color([0.4, 0.4, 0.4])
|
||||
cuboid([motor_width, motor_width, h], chamfer=2, edges=EDGES_Z_ALL, align=DOWN);
|
||||
cuboid([motor_width, motor_width, h], chamfer=2, edges=EDGES_Z_ALL, anchor=DOWN);
|
||||
color([0.4, 0.4, 0.4])
|
||||
cylinder(h=plinth_height, d=plinth_diam);
|
||||
color("silver")
|
||||
@@ -308,7 +308,7 @@ module nema23_stepper(h=50, shaft=6.35, shaft_len=25, orient=ORIENT_Z, align=DOW
|
||||
xspread(screw_spacing) {
|
||||
yspread(screw_spacing) {
|
||||
cyl(d=screw_size, h=screw_depth*3, $fn=max(12,segs(screw_size/2)));
|
||||
down(screw_depth) cuboid([screw_inset, screw_inset, h], align=DOWN);
|
||||
down(screw_depth) cuboid([screw_inset, screw_inset, h], anchor=DOWN);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -326,10 +326,10 @@ module nema23_stepper(h=50, shaft=6.35, shaft_len=25, orient=ORIENT_Z, align=DOW
|
||||
// shaft = Shaft diameter. Default: 12.7mm
|
||||
// shaft_len = Length of shaft protruding out the top of the stepper motor. Default: 32mm
|
||||
// orient = Orientation of the stepper. Use the `ORIENT_` constants from `constants.scad`. Default: `ORIENT_Z`.
|
||||
// align = Alignment of the stepper. Use the constants from `constants.scad`. Default: `DOWN`.
|
||||
// anchor = Alignment of the stepper. Use the constants from `constants.scad`. Default: `DOWN`.
|
||||
// Example:
|
||||
// nema34_stepper();
|
||||
module nema34_stepper(h=75, shaft=12.7, shaft_len=32, orient=ORIENT_Z, align=DOWN)
|
||||
module nema34_stepper(h=75, shaft=12.7, shaft_len=32, orient=ORIENT_Z, anchor=DOWN)
|
||||
{
|
||||
size = 34;
|
||||
motor_width = nema_motor_width(size);
|
||||
@@ -340,11 +340,11 @@ module nema34_stepper(h=75, shaft=12.7, shaft_len=32, orient=ORIENT_Z, align=DOW
|
||||
screw_depth = nema_motor_screw_depth(size);
|
||||
|
||||
screw_inset = motor_width - screw_spacing + 1;
|
||||
orient_and_align([motor_width, motor_width, h], orient, align, orig_align=DOWN, chain=true) {
|
||||
orient_and_anchor([motor_width, motor_width, h], orient, anchor, orig_anchor=DOWN, chain=true) {
|
||||
difference() {
|
||||
union() {
|
||||
color([0.4, 0.4, 0.4])
|
||||
cuboid(size=[motor_width, motor_width, h], chamfer=2, edges=EDGES_Z_ALL, align=DOWN);
|
||||
cuboid(size=[motor_width, motor_width, h], chamfer=2, edges=EDGES_Z_ALL, anchor=DOWN);
|
||||
color([0.4, 0.4, 0.4])
|
||||
cylinder(h=plinth_height, d=plinth_diam);
|
||||
color("silver")
|
||||
@@ -377,21 +377,21 @@ module nema34_stepper(h=75, shaft=12.7, shaft_len=32, orient=ORIENT_Z, align=DOW
|
||||
// l = The length of the slots, for making an adjustable motor mount. Default: 5
|
||||
// slop = The printer-specific slop value to make parts fit just right. Default: `PRINTER_SLOP`
|
||||
// orient = Orientation of the stepper. Use the `ORIENT_` constants from `constants.scad`. Default: `ORIENT_Z`.
|
||||
// align = Alignment of the stepper. Use the constants from `constants.scad`. Default: `CENTER`.
|
||||
// anchor = Alignment of the stepper. Use the constants from `constants.scad`. Default: `CENTER`.
|
||||
// Example:
|
||||
// nema_mount_holes(size=14, depth=5, l=5);
|
||||
// Example:
|
||||
// nema_mount_holes(size=17, depth=5, l=5);
|
||||
// Example:
|
||||
// nema_mount_holes(size=17, depth=5, l=0);
|
||||
module nema_mount_holes(size=17, depth=5, l=5, slop=PRINTER_SLOP, orient=ORIENT_Z, align=CENTER)
|
||||
module nema_mount_holes(size=17, depth=5, l=5, slop=PRINTER_SLOP, orient=ORIENT_Z, anchor=CENTER)
|
||||
{
|
||||
motor_width = nema_motor_width(size);
|
||||
plinth_diam = nema_motor_plinth_diam(size)+slop;
|
||||
screw_spacing = nema_motor_screw_spacing(size);
|
||||
screw_size = nema_motor_screw_size(size)+slop;
|
||||
|
||||
orient_and_align([motor_width, motor_width, l], orient, align, chain=true) {
|
||||
orient_and_anchor([motor_width, motor_width, l], orient, anchor, chain=true) {
|
||||
union() {
|
||||
xspread(screw_spacing) {
|
||||
yspread(screw_spacing) {
|
||||
@@ -427,14 +427,14 @@ module nema_mount_holes(size=17, depth=5, l=5, slop=PRINTER_SLOP, orient=ORIENT_
|
||||
// l = The length of the slots, for making an adjustable motor mount. Default: 5
|
||||
// slop = The printer-specific slop value to make parts fit just right. Default: `PRINTER_SLOP`
|
||||
// orient = Orientation of the stepper. Use the `ORIENT_` constants from `constants.scad`. Default: `ORIENT_Z`.
|
||||
// align = Alignment of the stepper. Use the constants from `constants.scad`. Default: `CENTER`.
|
||||
// anchor = Alignment of the stepper. Use the constants from `constants.scad`. Default: `CENTER`.
|
||||
// Example:
|
||||
// nema11_mount_holes(depth=5, l=5);
|
||||
// Example:
|
||||
// nema11_mount_holes(depth=5, l=0);
|
||||
module nema11_mount_holes(depth=5, l=5, slop=PRINTER_SLOP, orient=ORIENT_Z, align=CENTER)
|
||||
module nema11_mount_holes(depth=5, l=5, slop=PRINTER_SLOP, orient=ORIENT_Z, anchor=CENTER)
|
||||
{
|
||||
nema_mount_holes(size=11, depth=depth, l=l, slop=slop, orient=orient, align=align) children();
|
||||
nema_mount_holes(size=11, depth=depth, l=l, slop=slop, orient=orient, anchor=anchor) children();
|
||||
}
|
||||
|
||||
|
||||
@@ -446,14 +446,14 @@ module nema11_mount_holes(depth=5, l=5, slop=PRINTER_SLOP, orient=ORIENT_Z, alig
|
||||
// l = The length of the slots, for making an adjustable motor mount. Default: 5
|
||||
// slop = The printer-specific slop value to make parts fit just right. Default: `PRINTER_SLOP`
|
||||
// orient = Orientation of the stepper. Use the `ORIENT_` constants from `constants.scad`. Default: `ORIENT_Z`.
|
||||
// align = Alignment of the stepper. Use the constants from `constants.scad`. Default: `CENTER`.
|
||||
// anchor = Alignment of the stepper. Use the constants from `constants.scad`. Default: `CENTER`.
|
||||
// Example:
|
||||
// nema14_mount_holes(depth=5, l=5);
|
||||
// Example:
|
||||
// nema14_mount_holes(depth=5, l=0);
|
||||
module nema14_mount_holes(depth=5, l=5, slop=PRINTER_SLOP, orient=ORIENT_Z, align=CENTER)
|
||||
module nema14_mount_holes(depth=5, l=5, slop=PRINTER_SLOP, orient=ORIENT_Z, anchor=CENTER)
|
||||
{
|
||||
nema_mount_holes(size=14, depth=depth, l=l, slop=slop, orient=orient, align=align) children();
|
||||
nema_mount_holes(size=14, depth=depth, l=l, slop=slop, orient=orient, anchor=anchor) children();
|
||||
}
|
||||
|
||||
|
||||
@@ -465,14 +465,14 @@ module nema14_mount_holes(depth=5, l=5, slop=PRINTER_SLOP, orient=ORIENT_Z, alig
|
||||
// l = The length of the slots, for making an adjustable motor mount. Default: 5
|
||||
// slop = The printer-specific slop value to make parts fit just right. Default: `PRINTER_SLOP`
|
||||
// orient = Orientation of the stepper. Use the `ORIENT_` constants from `constants.scad`. Default: `ORIENT_Z`.
|
||||
// align = Alignment of the stepper. Use the constants from `constants.scad`. Default: `CENTER`.
|
||||
// anchor = Alignment of the stepper. Use the constants from `constants.scad`. Default: `CENTER`.
|
||||
// Example:
|
||||
// nema17_mount_holes(depth=5, l=5);
|
||||
// Example:
|
||||
// nema17_mount_holes(depth=5, l=0);
|
||||
module nema17_mount_holes(depth=5, l=5, slop=PRINTER_SLOP, orient=ORIENT_Z, align=CENTER)
|
||||
module nema17_mount_holes(depth=5, l=5, slop=PRINTER_SLOP, orient=ORIENT_Z, anchor=CENTER)
|
||||
{
|
||||
nema_mount_holes(size=17, depth=depth, l=l, slop=slop, orient=orient, align=align) children();
|
||||
nema_mount_holes(size=17, depth=depth, l=l, slop=slop, orient=orient, anchor=anchor) children();
|
||||
}
|
||||
|
||||
|
||||
@@ -484,14 +484,14 @@ module nema17_mount_holes(depth=5, l=5, slop=PRINTER_SLOP, orient=ORIENT_Z, alig
|
||||
// l = The length of the slots, for making an adjustable motor mount. Default: 5
|
||||
// slop = The printer-specific slop value to make parts fit just right. Default: `PRINTER_SLOP`
|
||||
// orient = Orientation of the stepper. Use the `ORIENT_` constants from `constants.scad`. Default: `ORIENT_Z`.
|
||||
// align = Alignment of the stepper. Use the constants from `constants.scad`. Default: `CENTER`.
|
||||
// anchor = Alignment of the stepper. Use the constants from `constants.scad`. Default: `CENTER`.
|
||||
// Example:
|
||||
// nema23_mount_holes(depth=5, l=5);
|
||||
// Example:
|
||||
// nema23_mount_holes(depth=5, l=0);
|
||||
module nema23_mount_holes(depth=5, l=5, slop=PRINTER_SLOP, orient=ORIENT_Z, align=CENTER)
|
||||
module nema23_mount_holes(depth=5, l=5, slop=PRINTER_SLOP, orient=ORIENT_Z, anchor=CENTER)
|
||||
{
|
||||
nema_mount_holes(size=23, depth=depth, l=l, slop=slop, orient=orient, align=align) children();
|
||||
nema_mount_holes(size=23, depth=depth, l=l, slop=slop, orient=orient, anchor=anchor) children();
|
||||
}
|
||||
|
||||
|
||||
@@ -503,14 +503,14 @@ module nema23_mount_holes(depth=5, l=5, slop=PRINTER_SLOP, orient=ORIENT_Z, alig
|
||||
// l = The length of the slots, for making an adjustable motor mount. Default: 5
|
||||
// slop = The printer-specific slop value to make parts fit just right. Default: `PRINTER_SLOP`
|
||||
// orient = Orientation of the stepper. Use the `ORIENT_` constants from `constants.scad`. Default: `ORIENT_Z`.
|
||||
// align = Alignment of the stepper. Use the constants from `constants.scad`. Default: `CENTER`.
|
||||
// anchor = Alignment of the stepper. Use the constants from `constants.scad`. Default: `CENTER`.
|
||||
// Example:
|
||||
// nema34_mount_holes(depth=5, l=5);
|
||||
// Example:
|
||||
// nema34_mount_holes(depth=5, l=0);
|
||||
module nema34_mount_holes(depth=5, l=5, slop=PRINTER_SLOP, orient=ORIENT_Z, align=CENTER)
|
||||
module nema34_mount_holes(depth=5, l=5, slop=PRINTER_SLOP, orient=ORIENT_Z, anchor=CENTER)
|
||||
{
|
||||
nema_mount_holes(size=34, depth=depth, l=l, slop=slop, orient=orient, align=align) children();
|
||||
nema_mount_holes(size=34, depth=depth, l=l, slop=slop, orient=orient, anchor=anchor) children();
|
||||
}
|
||||
|
||||
|
||||
@@ -522,14 +522,14 @@ module nema34_mount_holes(depth=5, l=5, slop=PRINTER_SLOP, orient=ORIENT_Z, alig
|
||||
// l = The length of the slots, for making an adjustable motor mount. Default: 5
|
||||
// slop = The printer-specific slop value to make parts fit just right. Default: `PRINTER_SLOP`
|
||||
// orient = Orientation of the stepper. Use the `ORIENT_` constants from `constants.scad`. Default: `ORIENT_Z`.
|
||||
// align = Alignment of the stepper. Use the constants from `constants.scad`. Default: `CENTER`.
|
||||
// anchor = Alignment of the stepper. Use the constants from `constants.scad`. Default: `CENTER`.
|
||||
// Example:
|
||||
// nema34_mount_holes(depth=5, l=5);
|
||||
// Example:
|
||||
// nema34_mount_holes(depth=5, l=0);
|
||||
module nema34_mount_holes(depth=5, l=5, slop=PRINTER_SLOP, orient=ORIENT_Z, align=CENTER)
|
||||
module nema34_mount_holes(depth=5, l=5, slop=PRINTER_SLOP, orient=ORIENT_Z, anchor=CENTER)
|
||||
{
|
||||
nema_mount_holes(size=34, depth=depth, l=l, slop=slop, orient=orient, align=align) children();
|
||||
nema_mount_holes(size=34, depth=depth, l=l, slop=slop, orient=orient, anchor=anchor) children();
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user