-
Notifications
You must be signed in to change notification settings - Fork 62
constants.scad
Useful Constants. To use this, add the following line to the top of your file.
include <BOSL/constants.scad>
Description: The printer specific amount of slop in mm to print with to make parts fit exactly. You may need to override this value for your printer.
Vectors useful for rotate()
, mirror()
, and align
arguments for cuboid()
, cyl()
, etc.
Description: Vector pointing left. [-1,0,0]
Example: Usage with align
cuboid(20, align=V_LEFT);
Description: Vector pointing right. [1,0,0]
Example: Usage with align
cuboid(20, align=V_RIGHT);
Description: Vector pointing forward. [0,-1,0]
Example: Usage with align
cuboid(20, align=V_FWD);
Description: Vector pointing back. [0,1,0]
Example: Usage with align
cuboid(20, align=V_BACK);
Description: Vector pointing down. [0,0,-1]
Example: Usage with align
cuboid(20, align=V_DOWN);
Description: Vector pointing up. [0,0,1]
Example: Usage with align
cuboid(20, align=V_UP);
Description: Vector pointing right, back, and up. [1,1,1]
Example: Usage with align
cuboid(20, align=V_ALLPOS);
Description: Vector pointing left, forwards, and down. [-1,-1,-1]
Example: Usage with align
cuboid(20, align=V_ALLNEG);
Description: Zero vector. Centered. [0,0,0]
Example: Usage with align
cuboid(20, align=V_ZERO);
Useful aliases for use with align
.
Description:
Centered, alias to V_ZERO
.
Description:
Vector pointing up, alias to V_UP
.
Description:
Vector pointing down, alias to V_DOWN
.
Description:
Vector pointing forward, alias to V_FWD
.
Description:
Vector pointing back, alias to V_BACK
.
Description:
Vector pointing up, alias to V_UP
.
Description:
Vector pointing down, alias to V_DOWN
.
Description:
Vector pointing forward, alias to V_FWD
.
Description:
Vector pointing back, alias to V_BACK
.
Constants for pre-orientation alignments.
Description: Align the axis-positive end to the origin.
Example 1: orient=ORIENT_X
cyl(d1=10, d2=5, h=20, orient=ORIENT_X, align=ALIGN_POS);
Example 2: orient=ORIENT_Y
cyl(d1=10, d2=5, h=20, orient=ORIENT_Y, align=ALIGN_POS);
Example 3: orient=ORIENT_Z
cyl(d1=10, d2=5, h=20, orient=ORIENT_Z, align=ALIGN_POS);
Example 4: orient=ORIENT_XNEG
cyl(d1=10, d2=5, h=20, orient=ORIENT_XNEG, align=ALIGN_POS);
Example 5: orient=ORIENT_YNEG
cyl(d1=10, d2=5, h=20, orient=ORIENT_YNEG, align=ALIGN_POS);
Example 6: orient=ORIENT_ZNEG
cyl(d1=10, d2=5, h=20, orient=ORIENT_ZNEG, align=ALIGN_POS);
Description: Align centered.
Description: Align the axis-negative end to the origin.
Example 1: orient=ORIENT_X
cyl(d1=10, d2=5, h=20, orient=ORIENT_X, align=ALIGN_NEG);
Example 2: orient=ORIENT_Y
cyl(d1=10, d2=5, h=20, orient=ORIENT_Y, align=ALIGN_NEG);
Example 3: orient=ORIENT_Z
cyl(d1=10, d2=5, h=20, orient=ORIENT_Z, align=ALIGN_NEG);
Example 4: orient=ORIENT_XNEG
cyl(d1=10, d2=5, h=20, orient=ORIENT_XNEG, align=ALIGN_NEG);
Example 5: orient=ORIENT_YNEG
cyl(d1=10, d2=5, h=20, orient=ORIENT_YNEG, align=ALIGN_NEG);
Example 6: orient=ORIENT_ZNEG
cyl(d1=10, d2=5, h=20, orient=ORIENT_ZNEG, align=ALIGN_NEG);
Orientations for cyl()
, prismoid()
, etc. They take the form of standard [X,Y,Z]
rotation angles for rotating a vertical shape into the given orientations.
Figure 1: Standard Orientations
Description: Orient along the X axis.
Description: Orient along the Y axis.
Description: Orient along the Z axis.
Description: Orient reversed along the X axis.
Description: Orient reversed along the Y axis.
Description: Orient reversed along the Z axis.
Orientations for cyl()
, prismoid()
, etc. They take the form of standard [X,Y,Z]
rotation angles for rotating a vertical shape into the given orientations.
Figure 2: Orientations Rotated 90º
Description: Orient along the X axis, then rotate 90 degrees counter-clockwise on that axis, as seen when facing the origin from that axis orientation.
Description: Orient along the Y axis, then rotate 90 degrees counter-clockwise on that axis, as seen when facing the origin from that axis orientation.
Description: Orient along the Z axis, then rotate 90 degrees counter-clockwise on that axis, as seen when facing the origin from that axis orientation.
Description: Orient reversed along the X axis, then rotate 90 degrees counter-clockwise on that axis, as seen when facing the origin from that axis orientation.
Description: Orient reversed along the Y axis, then rotate 90 degrees counter-clockwise on that axis, as seen when facing the origin from that axis orientation.
Description: Orient reversed along the Z axis, then rotate 90 degrees counter-clockwise on that axis, as seen when facing the origin from that axis orientation.
Orientations for cyl()
, prismoid()
, etc. They take the form of standard [X,Y,Z]
rotation angles for rotating a vertical shape into the given orientations.
Figure 3: Orientations Rotated 180º
Description: Orient along the X axis, then rotate 180 degrees counter-clockwise on that axis, as seen when facing the origin from that axis orientation.
Description: Orient along the Y axis, then rotate 180 degrees counter-clockwise on that axis, as seen when facing the origin from that axis orientation.
Description: Orient along the Z axis, then rotate 180 degrees counter-clockwise on that axis, as seen when facing the origin from that axis orientation.
Description: Orient reversed along the X axis, then rotate 180 degrees counter-clockwise on that axis, as seen when facing the origin from that axis orientation.
Description: Orient reversed along the Y axis, then rotate 180 degrees counter-clockwise on that axis, as seen when facing the origin from that axis orientation.
Description: Orient reversed along the Z axis, then rotate 180 degrees counter-clockwise on that axis, as seen when facing the origin from that axis orientation.
Orientations for cyl()
, prismoid()
, etc. They take the form of standard [X,Y,Z]
rotation angles for rotating a vertical shape into the given orientations.
Figure 4: Orientations Rotated 270º
Description: Orient along the X axis, then rotate 270 degrees counter-clockwise on that axis, as seen when facing the origin from that axis orientation.
Description: Orient along the Y axis, then rotate 270 degrees counter-clockwise on that axis, as seen when facing the origin from that axis orientation.
Description: Orient along the Z axis, then rotate 270 degrees counter-clockwise on that axis, as seen when facing the origin from that axis orientation.
Description: Orient reversed along the X axis, then rotate 270 degrees counter-clockwise on that axis, as seen when facing the origin from that axis orientation.
Description: Orient reversed along the Y axis, then rotate 270 degrees counter-clockwise on that axis, as seen when facing the origin from that axis orientation.
Description: Orient reversed along the Z axis, then rotate 270 degrees counter-clockwise on that axis, as seen when facing the origin from that axis orientation.
Constants for specifying edges for cuboid()
, etc.
Description: Top Back edge.
Description: Top Front edge.
Description: Bottom Front Edge.
Description: Bottom Back Edge.
Description: Top Right edge.
Description: Top Left edge.
Description: Bottom Left edge.
Description: Bottom Right edge.
Description: Back Right edge.
Description: Back Left edge.
Description: Front Left edge.
Description: Front Right edge.
Constants for specifying edges for cuboid()
, etc.
Description: Both X-aligned Top edges.
Description: Both X-aligned Bottom edges.
Description: Both X-aligned Front edges.
Description: Both X-aligned Back edges.
Description: All four X-aligned edges.
Description: Both Y-aligned Top edges.
Description: Both Y-aligned Bottom edges.
Description: Both Y-aligned Left edges.
Description: Both Y-aligned Right edges.
Description: All four Y-aligned edges.
Description: Both Z-aligned Back edges.
Description: Both Z-aligned Front edges.
Description: Both Z-aligned Left edges.
Description: Both Z-aligned Right edges.
Description: All four Z-aligned edges.
Description: All four Left edges.
Description: All four Right edges.
Description: All four Front edges.
Description: All four Back edges.
Description: All four Bottom edges.
Description: All four Top edges.
Description: No edges.
Description: All edges.
Description: Array of XYZ offsets to the center of each edge.
Description: Counts how many given edges intersect at a specific corner.
Argument | What it does |
---|---|
edges |
Standard edges array. |
v |
Vector pointing to the corner to count edge intersections at. |