more usage message updates

This commit is contained in:
Adrian Mariano 2022-03-31 19:36:56 -04:00
parent de67e5be43
commit c1cbfdfb12
3 changed files with 88 additions and 117 deletions

View file

@ -20,7 +20,7 @@
// Translates copies of all children to each given translation offset. // Translates copies of all children to each given translation offset.
// //
// Usage: // Usage:
// move_copies(a) children; // move_copies(a) CHILDREN;
// //
// Arguments: // Arguments:
// a = Array of XYZ offset vectors. Default `[[0,0,0]]` // a = Array of XYZ offset vectors. Default `[[0,0,0]]`
@ -47,15 +47,15 @@ module move_copies(a=[[0,0,0]])
// Function&Module: line_of() // Function&Module: line_of()
// //
// Usage: Spread `n` copies by a given spacing // Usage: Spread `n` copies by a given spacing
// line_of(spacing, [n], [p1=]) children; // line_of(spacing, [n], [p1=]) CHILDREN;
// Usage: Spread copies every given spacing along the line // Usage: Spread copies every given spacing along the line
// line_of(spacing, [l=], [p1=]) children; // line_of(spacing, [l=], [p1=]) CHILDREN;
// Usage: Spread `n` copies along the length of the line // Usage: Spread `n` copies along the length of the line
// line_of([n=], [l=], [p1=]) children; // line_of([n=], [l=], [p1=]) CHILDREN;
// Usage: Spread `n` copies along the line from `p1` to `p2` // Usage: Spread `n` copies along the line from `p1` to `p2`
// line_of([n=], [p1=], [p2=]) children; // line_of([n=], [p1=], [p2=]) CHILDREN;
// Usage: Spread copies every given spacing, centered along the line from `p1` to `p2` // Usage: Spread copies every given spacing, centered along the line from `p1` to `p2`
// line_of([spacing], [p1=], [p2=]) children; // line_of([spacing], [p1=], [p2=]) CHILDREN;
// Usage: As a function // Usage: As a function
// pts = line_of([spacing], [n], [p1=]); // pts = line_of([spacing], [n], [p1=]);
// pts = line_of([spacing], [l=], [p1=]); // pts = line_of([spacing], [l=], [p1=]);
@ -157,9 +157,9 @@ function line_of(spacing, n, l, p1, p2) =
// Spreads out `n` copies of the children along a line on the X axis. // Spreads out `n` copies of the children along a line on the X axis.
// //
// Usage: // Usage:
// xcopies(spacing, [n], [sp]) children; // xcopies(spacing, [n], [sp]) CHILDREN;
// xcopies(l, [n], [sp]) children; // xcopies(l, [n], [sp]) CHILDREN;
// xcopies(LIST) children; // xcopies(LIST) CHILDREN;
// //
// Arguments: // Arguments:
// spacing = Given a scalar, specifies a uniform spacing between copies. Given a list of scalars, each one gives a specific position along the line. (Default: 1.0) // spacing = Given a scalar, specifies a uniform spacing between copies. Given a list of scalars, each one gives a specific position along the line. (Default: 1.0)
@ -210,9 +210,9 @@ module xcopies(spacing, n, l, sp)
// Spreads out `n` copies of the children along a line on the Y axis. // Spreads out `n` copies of the children along a line on the Y axis.
// //
// Usage: // Usage:
// ycopies(spacing, [n], [sp]) children; // ycopies(spacing, [n], [sp]) CHILDREN;
// ycopies(l, [n], [sp]) children; // ycopies(l, [n], [sp]) CHILDREN;
// ycopies(LIST) children; // ycopies(LIST) CHILDREN;
// //
// Arguments: // Arguments:
// spacing = Given a scalar, specifies a uniform spacing between copies. Given a list of scalars, each one gives a specific position along the line. (Default: 1.0) // spacing = Given a scalar, specifies a uniform spacing between copies. Given a list of scalars, each one gives a specific position along the line. (Default: 1.0)
@ -263,9 +263,9 @@ module ycopies(spacing, n, l, sp)
// Spreads out `n` copies of the children along a line on the Z axis. // Spreads out `n` copies of the children along a line on the Z axis.
// //
// Usage: // Usage:
// zcopies(spacing, [n], [sp]) children; // zcopies(spacing, [n], [sp]) CHILDREN;
// zcopies(l, [n], [sp]) children; // zcopies(l, [n], [sp]) CHILDREN;
// zcopies(LIST) children; // zcopies(LIST) CHILDREN;
// //
// Arguments: // Arguments:
// spacing = Given a scalar, specifies a uniform spacing between copies. Given a list of scalars, each one gives a specific position along the line. (Default: 1.0) // spacing = Given a scalar, specifies a uniform spacing between copies. Given a list of scalars, each one gives a specific position along the line. (Default: 1.0)
@ -333,10 +333,10 @@ module zcopies(spacing, n, l, sp)
// Makes a square or hexagonal grid of copies of children, with an optional masking polygon or region. // Makes a square or hexagonal grid of copies of children, with an optional masking polygon or region.
// //
// Usage: // Usage:
// grid2d(spacing, size=, [stagger=], [scale=], [inside=]) children; // grid2d(spacing, size=, [stagger=], [scale=], [inside=]) CHILDREN;
// grid2d(n=, size=, [stagger=], [scale=], [inside=]) children; // grid2d(n=, size=, [stagger=], [scale=], [inside=]) CHILDREN;
// grid2d(spacing, [n], [stagger=], [scale=], [inside=]) children; // grid2d(spacing, [n], [stagger=], [scale=], [inside=]) CHILDREN;
// grid2d(n=, inside=, [stagger], [scale]) children; // grid2d(n=, inside=, [stagger], [scale]) CHILDREN;
// //
// Arguments: // Arguments:
// spacing = Distance between copies in [X,Y] or scalar distance. // spacing = Distance between copies in [X,Y] or scalar distance.
@ -476,9 +476,9 @@ module grid2d(spacing, n, size, stagger=false, inside=undef, nonzero)
// The first (unrotated) copy will be placed at the relative starting angle `sa`. // The first (unrotated) copy will be placed at the relative starting angle `sa`.
// //
// Usage: // Usage:
// rot_copies(rots, [cp=], [sa=], [delta=], [subrot=]) children; // rot_copies(rots, [cp=], [sa=], [delta=], [subrot=]) CHILDREN;
// rot_copies(rots, v, [cp=], [sa=], [delta=], [subrot=]) children; // rot_copies(rots, v, [cp=], [sa=], [delta=], [subrot=]) CHILDREN;
// rot_copies(n=, [v=], [cp=], [sa=], [delta=], [subrot=]) children; // rot_copies(n=, [v=], [cp=], [sa=], [delta=], [subrot=]) CHILDREN;
// //
// Arguments: // Arguments:
// rots = A list of [X,Y,Z] rotation angles in degrees. If `v` is given, this will be a list of scalar angles in degrees to rotate around `v`. // rots = A list of [X,Y,Z] rotation angles in degrees. If `v` is given, this will be a list of scalar angles in degrees to rotate around `v`.
@ -554,8 +554,8 @@ module rot_copies(rots=[], v=undef, cp=[0,0,0], n=undef, sa=0, offset=0, delta=[
// Module: xrot_copies() // Module: xrot_copies()
// //
// Usage: // Usage:
// xrot_copies(rots, [cp], [r=], [sa=], [subrot=]) children; // xrot_copies(rots, [cp], [r=], [sa=], [subrot=]) CHILDREN;
// xrot_copies(n=, [cp=], [r=], [sa=], [subrot=]) children; // xrot_copies(n=, [cp=], [r=], [sa=], [subrot=]) CHILDREN;
// //
// Description: // Description:
// Given an array of angles, rotates copies of the children to each of those angles around the X axis. // Given an array of angles, rotates copies of the children to each of those angles around the X axis.
@ -613,8 +613,8 @@ module xrot_copies(rots=[], cp=[0,0,0], n=undef, sa=0, r=0, subrot=true)
// Module: yrot_copies() // Module: yrot_copies()
// //
// Usage: // Usage:
// yrot_copies(rots, [cp], [r=], [sa=], [subrot=]) children; // yrot_copies(rots, [cp], [r=], [sa=], [subrot=]) CHILDREN;
// yrot_copies(n=, [cp=], [r=], [sa=], [subrot=]) children; // yrot_copies(n=, [cp=], [r=], [sa=], [subrot=]) CHILDREN;
// //
// Description: // Description:
// Given an array of angles, rotates copies of the children to each of those angles around the Y axis. // Given an array of angles, rotates copies of the children to each of those angles around the Y axis.
@ -672,8 +672,8 @@ module yrot_copies(rots=[], cp=[0,0,0], n=undef, sa=0, r=0, subrot=true)
// Module: zrot_copies() // Module: zrot_copies()
// //
// Usage: // Usage:
// zrot_copies(rots, [cp], [r=], [sa=], [subrot=]) children; // zrot_copies(rots, [cp], [r=], [sa=], [subrot=]) CHILDREN;
// zrot_copies(n=, [cp=], [r=], [sa=], [subrot=]) children; // zrot_copies(n=, [cp=], [r=], [sa=], [subrot=]) CHILDREN;
// //
// Description: // Description:
// Given an array of angles, rotates copies of the children to each of those angles around the Z axis. // Given an array of angles, rotates copies of the children to each of those angles around the Z axis.
@ -733,8 +733,8 @@ module zrot_copies(rots=[], cp=[0,0,0], n=undef, sa=0, r=0, subrot=true)
// Evenly distributes n duplicate children around an ovoid arc on the XY plane. // Evenly distributes n duplicate children around an ovoid arc on the XY plane.
// //
// Usage: // Usage:
// arc_of(n, r|d=, [sa=], [ea=], [rot=]) children; // arc_of(n, r|d=, [sa=], [ea=], [rot=]) CHILDREN;
// arc_of(n, rx=|dx=, ry=|dy=, [sa=], [ea=], [rot=]) children; // arc_of(n, rx=|dx=, ry=|dy=, [sa=], [ea=], [rot=]) CHILDREN;
// //
// Arguments: // Arguments:
// n = number of copies to distribute around the circle. (Default: 6) // n = number of copies to distribute around the circle. (Default: 6)
@ -807,7 +807,7 @@ module arc_of(
// Spreads children semi-evenly over the surface of a sphere. // Spreads children semi-evenly over the surface of a sphere.
// //
// Usage: // Usage:
// ovoid_spread(n, r|d=, [cone_ang=], [scale=], [perp=]) children; // ovoid_spread(n, r|d=, [cone_ang=], [scale=], [perp=]) CHILDREN;
// //
// Arguments: // Arguments:
// n = How many copies to evenly spread over the surface. // n = How many copies to evenly spread over the surface.
@ -873,7 +873,7 @@ module ovoid_spread(n=100, r=undef, d=undef, cone_ang=90, scale=[1,1,1], perp=tr
// If you specify `sp` then the copies will start at `sp`. // If you specify `sp` then the copies will start at `sp`.
// //
// Usage: // Usage:
// path_spread(path, [n], [spacing], [sp], [rotate_children], [closed]) children; // path_spread(path, [n], [spacing], [sp], [rotate_children], [closed]) CHILDREN;
// //
// Arguments: // Arguments:
// path = path or 1-region where children are placed // path = path or 1-region where children are placed
@ -1009,7 +1009,7 @@ module path_spread(path, n, spacing, sp=undef, rotate_children=true, closed)
// Makes a copy of the children, mirrored across the given plane. // Makes a copy of the children, mirrored across the given plane.
// //
// Usage: // Usage:
// mirror_copy(v, [cp], [offset]) children; // mirror_copy(v, [cp], [offset]) CHILDREN;
// //
// Arguments: // Arguments:
// v = The normal vector of the plane to mirror across. // v = The normal vector of the plane to mirror across.
@ -1064,7 +1064,7 @@ module mirror_copy(v=[0,0,1], offset=0, cp)
// Makes a copy of the children, mirrored across the X axis. // Makes a copy of the children, mirrored across the X axis.
// //
// Usage: // Usage:
// xflip_copy([offset], [x]) children; // xflip_copy([offset], [x]) CHILDREN;
// //
// Arguments: // Arguments:
// offset = Distance to offset children right, before copying. // offset = Distance to offset children right, before copying.
@ -1098,7 +1098,7 @@ module xflip_copy(offset=0, x=0)
// Makes a copy of the children, mirrored across the Y axis. // Makes a copy of the children, mirrored across the Y axis.
// //
// Usage: // Usage:
// yflip_copy([offset], [y]) children; // yflip_copy([offset], [y]) CHILDREN;
// //
// Arguments: // Arguments:
// offset = Distance to offset children back, before copying. // offset = Distance to offset children back, before copying.
@ -1132,7 +1132,7 @@ module yflip_copy(offset=0, y=0)
// Makes a copy of the children, mirrored across the Z axis. // Makes a copy of the children, mirrored across the Z axis.
// //
// Usage: // Usage:
// zflip_copy([offset], [z]) children; // zflip_copy([offset], [z]) CHILDREN;
// //
// Arguments: // Arguments:
// offset = Distance to offset children up, before copying. // offset = Distance to offset children up, before copying.
@ -1172,8 +1172,8 @@ module zflip_copy(offset=0, z=0)
// where you only really care about the spacing between them. // where you only really care about the spacing between them.
// //
// Usage: // Usage:
// distribute(spacing, sizes, dir) children; // distribute(spacing, sizes, dir) CHILDREN;
// distribute(l=, [sizes=], [dir=]) children; // distribute(l=, [sizes=], [dir=]) CHILDREN;
// //
// Arguments: // Arguments:
// spacing = Spacing to add between each child. (Default: 10.0) // spacing = Spacing to add between each child. (Default: 10.0)
@ -1218,8 +1218,8 @@ module distribute(spacing=undef, sizes=undef, dir=RIGHT, l=undef)
// where you only really care about the spacing between them. // where you only really care about the spacing between them.
// //
// Usage: // Usage:
// xdistribute(spacing, [sizes]) children; // xdistribute(spacing, [sizes]) CHILDREN;
// xdistribute(l=, [sizes=]) children; // xdistribute(l=, [sizes=]) CHILDREN;
// //
// Arguments: // Arguments:
// spacing = spacing between each child. (Default: 10.0) // spacing = spacing between each child. (Default: 10.0)
@ -1264,8 +1264,8 @@ module xdistribute(spacing=10, sizes=undef, l=undef)
// where you only really care about the spacing between them. // where you only really care about the spacing between them.
// //
// Usage: // Usage:
// ydistribute(spacing, [sizes]) children; // ydistribute(spacing, [sizes]) CHILDREN;
// ydistribute(l=, [sizes=]) children; // ydistribute(l=, [sizes=]) CHILDREN;
// //
// Arguments: // Arguments:
// spacing = spacing between each child. (Default: 10.0) // spacing = spacing between each child. (Default: 10.0)
@ -1310,8 +1310,8 @@ module ydistribute(spacing=10, sizes=undef, l=undef)
// where you only really care about the spacing between them. // where you only really care about the spacing between them.
// //
// Usage: // Usage:
// zdistribute(spacing, [sizes]) children; // zdistribute(spacing, [sizes]) CHILDREN;
// zdistribute(l=, [sizes=]) children; // zdistribute(l=, [sizes=]) CHILDREN;
// //
// Arguments: // Arguments:
// spacing = spacing between each child. (Default: 10.0) // spacing = spacing between each child. (Default: 10.0)

View file

@ -756,6 +756,7 @@ function right_triangle(size=[1,1], center, anchor, spin=0) =
anchor = get_anchor(anchor, center, [-1,-1], [-1,-1]) anchor = get_anchor(anchor, center, [-1,-1], [-1,-1])
) )
assert(is_vector(size,2)) assert(is_vector(size,2))
assert(min(size)>0, "Must give positive size")
let( let(
path = [ [size.x/2,-size.y/2], [-size.x/2,-size.y/2], [-size.x/2,size.y/2] ] path = [ [size.x/2,-size.y/2], [-size.x/2,-size.y/2], [-size.x/2,size.y/2] ]
) reorient(anchor,spin, two_d=true, size=[size.x,size.y], size2=0, shift=-size.x/2, p=path); ) reorient(anchor,spin, two_d=true, size=[size.x,size.y], size2=0, shift=-size.x/2, p=path);

View file

@ -22,7 +22,7 @@ use <builtins.scad>
// Usage: As Module // Usage: As Module
// cube(size, [center], ...); // cube(size, [center], ...);
// Usage: With Attachments // Usage: With Attachments
// cube(size, [center], ...) { attachments } // cube(size, [center], ...) [ATTACHMENTS];
// Usage: As Function // Usage: As Function
// vnf = cube(size, [center], ...); // vnf = cube(size, [center], ...);
// See Also: cuboid(), prismoid() // See Also: cuboid(), prismoid()
@ -96,7 +96,7 @@ function cube(size=1, center, anchor, spin=0, orient=UP) =
// Usage: Rounded Cubes // Usage: Rounded Cubes
// cuboid(size, [rounding=], [teardrop=], [edges=], [except=], [trimcorners=], ...); // cuboid(size, [rounding=], [teardrop=], [edges=], [except=], [trimcorners=], ...);
// Usage: Attaching children // Usage: Attaching children
// cuboid(size, [anchor=], ...) [attachments]; // cuboid(...) ATTACHMENTS;
// //
// Description: // Description:
// Creates a cube or cuboid object, with optional chamfering or rounding of edges and corners. // Creates a cube or cuboid object, with optional chamfering or rounding of edges and corners.
@ -490,15 +490,13 @@ function cuboid(
// Function&Module: prismoid() // Function&Module: prismoid()
// //
// Usage: Typical Prismoids // Usage: Typical Prismoids
// prismoid(size1, size2, h|l, [shift], ...); // prismoid(size1, size2, h|l, [shift], ...) [ATTACHMENTS];
// Usage: Attaching Children
// prismoid(size1, size2, h|l, [shift], ...) [attachments];
// Usage: Chamfered Prismoids // Usage: Chamfered Prismoids
// prismoid(size1, size2, h|l, [chamfer=], ...); // prismoid(size1, size2, h|l, [chamfer=], ...) [ATTACHMENTS];
// prismoid(size1, size2, h|l, [chamfer1=], [chamfer2=], ...); // prismoid(size1, size2, h|l, [chamfer1=], [chamfer2=], ...) [ATTACHMENTS];
// Usage: Rounded Prismoids // Usage: Rounded Prismoids
// prismoid(size1, size2, h|l, [rounding=], ...); // prismoid(size1, size2, h|l, [rounding=], ...) [ATTACHMENTS];
// prismoid(size1, size2, h|l, [rounding1=], [rounding2=], ...); // prismoid(size1, size2, h|l, [rounding1=], [rounding2=], ...) [ATTACHMENTS];
// Usage: As Function // Usage: As Function
// vnf = prismoid(size1, size2, h|l, [shift], [rounding], [chamfer]); // vnf = prismoid(size1, size2, h|l, [shift], [rounding], [chamfer]);
// vnf = prismoid(size1, size2, h|l, [shift], [rounding1], [rounding2], [chamfer1], [chamfer2]); // vnf = prismoid(size1, size2, h|l, [shift], [rounding1], [rounding2], [chamfer1], [chamfer2]);
@ -692,9 +690,7 @@ function prismoid(
// Function&Module: octahedron() // Function&Module: octahedron()
// Usage: As Module // Usage: As Module
// octahedron(size, ...); // octahedron(size, ...) [ATTACHMENTS];
// Usage: With Attachments
// octahedron(size, ...) { attachments }
// Usage: As Function // Usage: As Function
// vnf = octahedron(size, ...); // vnf = octahedron(size, ...);
// Description: // Description:
@ -750,7 +746,7 @@ function octahedron(size=1, anchor=CENTER, spin=0, orient=UP) =
// rect_tube(h, size, isize, irounding1=, irounding2= ...); // rect_tube(h, size, isize, irounding1=, irounding2= ...);
// rect_tube(h, size, isize, rounding=, irounding=, ...); // rect_tube(h, size, isize, rounding=, irounding=, ...);
// Usage: Attaching Children // Usage: Attaching Children
// rect_tube(h, size, isize, ...) [attachments]; // rect_tube(...) ATTACHMENTS;
// //
// Description: // Description:
// Creates a rectangular or prismoid tube with optional roundovers and/or chamfers. // Creates a rectangular or prismoid tube with optional roundovers and/or chamfers.
@ -924,9 +920,7 @@ function rect_tube(
// Function&Module: wedge() // Function&Module: wedge()
// //
// Usage: As Module // Usage: As Module
// wedge(size, [center], ...); // wedge(size, [center], ...) [ATTACHMENTS];
// Usage: With Attachments
// wedge(size, [center], ...) { attachments }
// Usage: As Function // Usage: As Function
// vnf = wedge(size, [center], ...); // vnf = wedge(size, [center], ...);
// //
@ -985,10 +979,8 @@ function wedge(size=[1,1,1], center, anchor, spin=0, orient=UP) =
// Function&Module: cylinder() // Function&Module: cylinder()
// Topics: Shapes (3D), Attachable, VNF Generators // Topics: Shapes (3D), Attachable, VNF Generators
// Usage: As Module // Usage: As Module
// cylinder(h, r=/d=, [center=], ...); // cylinder(h, r=/d=, [center=], ...) [ATTACHMENTS];
// cylinder(h, r1/d1=, r2/d2=, [center=], ...); // cylinder(h, r1/d1=, r2/d2=, [center=], ...) [ATTACHMENTS];
// Usage: With Attachments
// cylinder(h, r=/d=, [center=]) {attachments}
// Usage: As Function // Usage: As Function
// vnf = cylinder(h, r=/d=, [center=], ...); // vnf = cylinder(h, r=/d=, [center=], ...);
// vnf = cylinder(h, r1/d1=, r2/d2=, [center=], ...); // vnf = cylinder(h, r1/d1=, r2/d2=, [center=], ...);
@ -1073,10 +1065,10 @@ function cylinder(h, r1, r2, center, l, r, d, d1, d2, anchor, spin=0, orient=UP)
// the cylinder's length. // the cylinder's length.
// //
// Usage: Normal Cylinders // Usage: Normal Cylinders
// cyl(l|h, r, [center], [circum=], [realign=]); // cyl(l|h, r, [center], [circum=], [realign=]) [ATTACHMENTS];
// cyl(l|h, d=, ...); // cyl(l|h, d=, ...) [ATTACHMENTS];
// cyl(l|h, r1=, r2=, ...); // cyl(l|h, r1=, r2=, ...) [ATTACHMENTS];
// cyl(l|h, d1=, d2=, ...); // cyl(l|h, d1=, d2=, ...) [ATTACHMENTS];
// //
// Usage: Chamferred Cylinders // Usage: Chamferred Cylinders
// cyl(l|h, r|d, chamfer=, [chamfang=], [from_end=], ...); // cyl(l|h, r|d, chamfer=, [chamfang=], [from_end=], ...);
@ -1273,11 +1265,8 @@ module cyl(
// Creates a cylinder oriented along the X axis. // Creates a cylinder oriented along the X axis.
// //
// Usage: Typical // Usage: Typical
// xcyl(l|h, r, [anchor=]); // xcyl(l|h, r|d=, [anchor=], ...) [ATTACHMENTS];
// xcyl(l|h, d=, [anchor=]); // xcyl(l|h, r1=|d1=, r2=|d2=, [anchor=], ...) [ATTACHMENTS];
// xcyl(l|h, r1=|d1=, r2=|d2=, [anchor=]);
// Usage: Attaching Children
// xcyl(l|h, r, [anchor=]) [attachments];
// //
// Arguments: // Arguments:
// l / h = Length of cylinder along oriented axis. Default: 1 // l / h = Length of cylinder along oriented axis. Default: 1
@ -1346,11 +1335,8 @@ module xcyl(
// Creates a cylinder oriented along the Y axis. // Creates a cylinder oriented along the Y axis.
// //
// Usage: Typical // Usage: Typical
// ycyl(l|h, r, [anchor=]); // ycyl(l|h, r|d=, [anchor=], ...) [ATTACHMENTS];
// ycyl(l|h, d=, [anchor=]); // ycyl(l|h, r1=|d1=, r2=|d2=, [anchor=], ...) [ATTACHMENTS];
// ycyl(l|h, r1=|d1=, r2=|d2=, [anchor=]);
// Usage: Attaching Children
// ycyl(l|h, r, [anchor=]) [attachments];
// //
// Arguments: // Arguments:
// l / h = Length of cylinder along oriented axis. (Default: `1.0`) // l / h = Length of cylinder along oriented axis. (Default: `1.0`)
@ -1420,11 +1406,8 @@ module ycyl(
// Creates a cylinder oriented along the Z axis. // Creates a cylinder oriented along the Z axis.
// //
// Usage: Typical // Usage: Typical
// zcyl(l|h, r, [anchor=]); // zcyl(l|h, r|d=, [anchor=],...) [ATTACHMENTS];
// zcyl(l|h, d=, [anchor=]); // zcyl(l|h, r1=|d1=, r2=|d2=, [anchor=],...);
// zcyl(l|h, r1=|d1=, r2=|d2=, [anchor=]);
// Usage: Attaching Children
// zcyl(l|h, r, [anchor=]) [attachments];
// //
// Arguments: // Arguments:
// l / h = Length of cylinder along oriented axis. (Default: 1.0) // l / h = Length of cylinder along oriented axis. (Default: 1.0)
@ -1502,7 +1485,7 @@ module zcyl(
// tube(h|l, or1|od1, or2|od2, wall, ...); // tube(h|l, or1|od1, or2|od2, wall, ...);
// tube(h|l, ir1|id1, ir2|id2, or1|od1, or2|od2, [realign]); // tube(h|l, ir1|id1, ir2|id2, or1|od1, or2|od2, [realign]);
// Usage: Attaching Children // Usage: Attaching Children
// tube(h|l, or, ir, [center]) [attachments]; // tube(...) ATTACHMENTS;
// //
// Arguments: // Arguments:
// h / l = height of tube. Default: 1 // h / l = height of tube. Default: 1
@ -1589,7 +1572,7 @@ module tube(
// vnf = pie_slice(l|h, d=, ang=, ...); // vnf = pie_slice(l|h, d=, ang=, ...);
// vnf = pie_slice(l|h, r1=|d1=, r2=|d2=, ang=, ...); // vnf = pie_slice(l|h, r1=|d1=, r2=|d2=, ang=, ...);
// Usage: Attaching Children // Usage: Attaching Children
// pie_slice(l|h, r, ang, ...) [attachments]; // pie_slice(l|h, r, ang, ...) ATTACHMENTS;
// //
// Arguments: // Arguments:
// h / l = height of pie slice. // h / l = height of pie slice.
@ -1674,9 +1657,7 @@ function pie_slice(
// Function&Module: sphere() // Function&Module: sphere()
// Topics: Shapes (3D), Attachable, VNF Generators // Topics: Shapes (3D), Attachable, VNF Generators
// Usage: As Module // Usage: As Module
// sphere(r|d=, [circum=], [style=], ...); // sphere(r|d=, [circum=], [style=], ...) [ATTACHMENTS];
// Usage: With Attachments
// sphere(r|d=, ...) { attachments }
// Usage: As Function // Usage: As Function
// vnf = sphere(r|d=, [circum=], [style=], ...); // vnf = sphere(r|d=, [circum=], [style=], ...);
// See Also: spheroid() // See Also: spheroid()
@ -1740,9 +1721,7 @@ function sphere(r, d, circum=false, style="orig", anchor=CENTER, spin=0, orient=
// Function&Module: spheroid() // Function&Module: spheroid()
// Usage: Typical // Usage: Typical
// spheroid(r|d, [circum], [style]); // spheroid(r|d, [circum], [style]) [ATTACHMENTS];
// Usage: Attaching Children
// spheroid(r|d, [circum], [style]) [attachments];
// Usage: As Function // Usage: As Function
// vnf = spheroid(r|d, [circum], [style]); // vnf = spheroid(r|d, [circum], [style]);
// Description: // Description:
@ -2069,14 +2048,12 @@ function spheroid(r, style="aligned", d, circum=false, anchor=CENTER, spin=0, or
// Function&Module: torus() // Function&Module: torus()
// //
// Usage: As Module // Usage: As Module
// torus(r_maj|d_maj, r_min|d_min, [center], ...); // torus(r_maj|d_maj, r_min|d_min, [center], ...) [ATTACHMENTS];
// torus(or|od, ir|id, ...); // torus(or|od, ir|id, ...) [ATTACHMENTS];
// torus(r_maj|d_maj, or|od, ...); // torus(r_maj|d_maj, or|od, ...) [ATTACHMENTS];
// torus(r_maj|d_maj, ir|id, ...); // torus(r_maj|d_maj, ir|id, ...) [ATTACHMENTS];
// torus(r_min|d_min, or|od, ...); // torus(r_min|d_min, or|od, ...) [ATTACHMENTS];
// torus(r_min|d_min, ir|id, ...); // torus(r_min|d_min, ir|id, ...) [ATTACHMENTS];
// Usage: Attaching Children
// torus(or|od, ir|id, ...) [attachments];
// Usage: As Function // Usage: As Function
// vnf = torus(r_maj|d_maj, r_min|d_min, [center], ...); // vnf = torus(r_maj|d_maj, r_min|d_min, [center], ...);
// vnf = torus(or|od, ir|id, ...); // vnf = torus(or|od, ir|id, ...);
@ -2213,13 +2190,11 @@ function torus(
// Makes a teardrop shape in the XZ plane. Useful for 3D printable holes. // Makes a teardrop shape in the XZ plane. Useful for 3D printable holes.
// //
// Usage: Typical // Usage: Typical
// teardrop(h|l, r, [ang], [cap_h], ...); // teardrop(h|l, r, [ang], [cap_h], ...) [ATTACHMENTS];
// teardrop(h|l, d=, [ang=], [cap_h=], ...); // teardrop(h|l, d=, [ang=], [cap_h=], ...) [ATTACHMENTS];
// Usage: Psuedo-Conical // Usage: Psuedo-Conical
// teardrop(h|l, r1=, r2=, [ang=], [cap_h1=], [cap_h2=], ...); // teardrop(h|l, r1=, r2=, [ang=], [cap_h1=], [cap_h2=], ...) [ATTACHMENTS];
// teardrop(h|l, d1=, d2=, [ang=], [cap_h1=], [cap_h2=], ...); // teardrop(h|l, d1=, d2=, [ang=], [cap_h1=], [cap_h2=], ...) [ATTACHMENTS];
// Usage: Attaching Children
// teardrop(h|l, r, ...) [attachments];
// Usage: As Function // Usage: As Function
// vnf = teardrop(h|l=, r|d=, [ang=], [cap_h=], ...); // vnf = teardrop(h|l=, r|d=, [ang=], [cap_h=], ...);
// vnf = teardrop(h|l=, r1=|d1=, r2=|d2=, [ang=], [cap_h=], ...); // vnf = teardrop(h|l=, r1=|d1=, r2=|d2=, [ang=], [cap_h=], ...);
@ -2348,9 +2323,7 @@ function teardrop(h, r, ang=45, cap_h, r1, r2, d, d1, d2, cap_h1, cap_h2, l, anc
// Creates a sphere with a conical hat, to make a 3D teardrop. // Creates a sphere with a conical hat, to make a 3D teardrop.
// //
// Usage: As Module // Usage: As Module
// onion(r|d=, [ang=], [cap_h=], ...); // onion(r|d=, [ang=], [cap_h=], ...) [ATTACHMENTS];
// Usage: Attaching Children
// onion(r, ...) [attachments];
// Usage: As Function // Usage: As Function
// vnf = onion(r|d=, [ang=], [cap_h=], ...); // vnf = onion(r|d=, [ang=], [cap_h=], ...);
// //
@ -2530,7 +2503,7 @@ function _cut_interp(pathcut, path, data) =
// Module: path_text() // Module: path_text()
// Usage: // Usage:
// path_text(path, text, [size], [thickness], [font], [lettersize], [offset], [reverse], [normal], [top], [textmetrics]) // path_text(path, text, [size], [thickness], [font], [lettersize], [offset], [reverse], [normal], [top], [textmetrics], [kern])
// Description: // Description:
// Place the text letter by letter onto the specified path using textmetrics (if available and requested) // Place the text letter by letter onto the specified path using textmetrics (if available and requested)
// or user specified letter spacing. The path can be 2D or 3D. In 2D the text appears along the path with letters upright // or user specified letter spacing. The path can be 2D or 3D. In 2D the text appears along the path with letters upright
@ -2638,6 +2611,7 @@ function _cut_interp(pathcut, path, data) =
module path_text(path, text, font, size, thickness, lettersize, offset=0, reverse=false, normal, top, center=false, textmetrics=false, kern=0) module path_text(path, text, font, size, thickness, lettersize, offset=0, reverse=false, normal, top, center=false, textmetrics=false, kern=0)
{ {
no_children($children);
dummy2=assert(is_path(path,[2,3]),"Must supply a 2d or 3d path") dummy2=assert(is_path(path,[2,3]),"Must supply a 2d or 3d path")
assert(num_defined([normal,top])<=1, "Cannot define both \"normal\" and \"top\""); assert(num_defined([normal,top])<=1, "Cannot define both \"normal\" and \"top\"");
dim = len(path[0]); dim = len(path[0]);
@ -2716,10 +2690,8 @@ module path_text(path, text, font, size, thickness, lettersize, offset=0, revers
// Center this part along the concave edge to be chamfered and union it in. // Center this part along the concave edge to be chamfered and union it in.
// //
// Usage: Typical // Usage: Typical
// interior_fillet(l, r, [ang], [overlap], ...); // interior_fillet(l, r, [ang], [overlap], ...) [ATTACHMENTS];
// interior_fillet(l, d=, [ang=], [overlap=], ...); // interior_fillet(l, d=, [ang=], [overlap=], ...) [ATTACHMENTS];
// Usage: Attaching Children
// interior_fillet(l, r, [ang], [overlap], ...) [attachments];
// //
// Arguments: // Arguments:
// l = Length of edge to fillet. // l = Length of edge to fillet.
@ -2777,9 +2749,7 @@ module interior_fillet(l=1.0, r, ang=90, overlap=0.01, d, anchor=FRONT+LEFT, spi
// Function&Module: heightfield() // Function&Module: heightfield()
// Usage: As Module // Usage: As Module
// heightfield(data, [size], [bottom], [maxz], [xrange], [yrange], [style], [convexity], ...); // heightfield(data, [size], [bottom], [maxz], [xrange], [yrange], [style], [convexity], ...) [ATTACHMENTS];
// Usage: Attaching Children
// heightfield(data, [size], ...) [attachments];
// Usage: As Function // Usage: As Function
// vnf = heightfield(data, [size], [bottom], [maxz], [xrange], [yrange], [style], ...); // vnf = heightfield(data, [size], [bottom], [maxz], [xrange], [yrange], [style], ...);
// Description: // Description:
@ -2904,7 +2874,7 @@ function heightfield(data, size=[100,100], bottom=-20, maxz=100, xrange=[-1:0.04
// Module: ruler() // Module: ruler()
// Usage: // Usage:
// ruler(length, width, [thickness=], [depth=], [labels=], [pipscale=], [maxscale=], [colors=], [alpha=], [unit=], [inch=]); // ruler(length, width, [thickness=], [depth=], [labels=], [pipscale=], [maxscale=], [colors=], [alpha=], [unit=], [inch=]) [ATTACHMENTS];
// Description: // Description:
// Creates a ruler for checking dimensions of the model // Creates a ruler for checking dimensions of the model
// Arguments: // Arguments: