usage messages fixes, req_children additions

This commit is contained in:
Adrian Mariano 2022-03-31 18:12:23 -04:00
parent a34c689889
commit 7afef10a79
10 changed files with 158 additions and 168 deletions

View file

@ -390,7 +390,7 @@ _ANCHOR_TYPES = ["intersect","hull"];
// Module: position() // Module: position()
// Usage: // Usage:
// position(from) {...} // position(from) CHILDREN;
// //
// Topics: Attachments // Topics: Attachments
// See Also: attachable(), attach(), orient() // See Also: attachable(), attach(), orient()
@ -408,6 +408,7 @@ _ANCHOR_TYPES = ["intersect","hull"];
// } // }
module position(from) module position(from)
{ {
req_children($children);
assert($parent_geom != undef, "No object to attach to!"); assert($parent_geom != undef, "No object to attach to!");
anchors = (is_vector(from)||is_string(from))? [from] : from; anchors = (is_vector(from)||is_string(from))? [from] : from;
for (anchr = anchors) { for (anchr = anchors) {
@ -422,8 +423,8 @@ module position(from)
// Module: orient() // Module: orient()
// Usage: // Usage:
// orient(dir, <spin=>) ... // orient(dir, [spin=]) CHILDREN;
// orient(anchor=, <spin=>) ... // orient(anchor=, [spin=]) CHILDREN;
// Topics: Attachments // Topics: Attachments
// Description: // Description:
// Orients children such that their top is tilted towards the given direction, or towards the // Orients children such that their top is tilted towards the given direction, or towards the
@ -460,6 +461,7 @@ module position(from)
// prismoid([30,30],[0,5],h=20,anchor=BOT+BACK); // prismoid([30,30],[0,5],h=20,anchor=BOT+BACK);
// } // }
module orient(dir, anchor, spin) { module orient(dir, anchor, spin) {
req_children($children);
if (!is_undef(dir)) { if (!is_undef(dir)) {
assert(anchor==undef, "Only one of dir= or anchor= may be given to orient()"); assert(anchor==undef, "Only one of dir= or anchor= may be given to orient()");
assert(is_vector(dir)); assert(is_vector(dir));
@ -486,11 +488,10 @@ module orient(dir, anchor, spin) {
// Module: attach() // Module: attach()
// Usage: // Usage:
// attach(from, [overlap=], [norot=]) {...} // attach(from, [overlap=], [norot=]) CHILDREN;
// attach(from, to, [overlap=], [norot=]) {...} // attach(from, to, [overlap=], [norot=]) CHILDREN;
// Topics: Attachments // Topics: Attachments
// See Also: attachable(), position(), face_profile(), edge_profile(), corner_profile() // See Also: attachable(), position(), face_profile(), edge_profile(), corner_profile()
// Description: // Description:
@ -514,6 +515,7 @@ module orient(dir, anchor, spin) {
// } // }
module attach(from, to, overlap, norot=false) module attach(from, to, overlap, norot=false)
{ {
req_children($children);
assert($parent_geom != undef, "No object to attach to!"); assert($parent_geom != undef, "No object to attach to!");
overlap = (overlap!=undef)? overlap : $overlap; overlap = (overlap!=undef)? overlap : $overlap;
anchors = (is_vector(from)||is_string(from))? [from] : from; anchors = (is_vector(from)||is_string(from))? [from] : from;
@ -537,7 +539,7 @@ module attach(from, to, overlap, norot=false)
// Module: tags() // Module: tags()
// Usage: // Usage:
// tags(tags) {...} // tags(tags) CHILDREN;
// Topics: Attachments // Topics: Attachments
// See Also: force_tags(), recolor(), hide(), show(), diff(), intersect() // See Also: force_tags(), recolor(), hide(), show(), diff(), intersect()
// Description: // Description:
@ -559,7 +561,8 @@ module attach(from, to, overlap, norot=false)
// } // }
// } // }
module tags(tags) module tags(tags)
{ {
req_children($children);
$tags = tags; $tags = tags;
children(); children();
} }
@ -567,7 +570,7 @@ module tags(tags)
// Module: force_tags() // Module: force_tags()
// Usage: // Usage:
// force_tags([tags]) {...} // force_tags([tags]) CHILDREN;
// Topics: Attachments // Topics: Attachments
// See Also: tags(), recolor(), hide(), show(), diff(), intersect() // See Also: tags(), recolor(), hide(), show(), diff(), intersect()
// Description: // Description:
@ -609,6 +612,7 @@ module tags(tags)
// } // }
module force_tags(tags) module force_tags(tags)
{ {
req_children($children);
$tags = is_def(tags) ? tags : $tags; $tags = is_def(tags) ? tags : $tags;
if(_attachment_is_shown($tags)) { if(_attachment_is_shown($tags)) {
children(); children();
@ -618,7 +622,7 @@ module force_tags(tags)
// Module: diff() // Module: diff()
// Usage: // Usage:
// diff(neg, [keep]) {...} // diff(neg, [keep]) CHILDREN;
// Topics: Attachments // Topics: Attachments
// See Also: tags(), recolor(), show(), hide(), intersect() // See Also: tags(), recolor(), show(), hide(), intersect()
// Description: // Description:
@ -706,6 +710,7 @@ module force_tags(tags)
// } // }
module diff(neg, keep) module diff(neg, keep)
{ {
req_children($children);
// Don't perform the operation if the current tags are hidden // Don't perform the operation if the current tags are hidden
if (_attachment_is_shown($tags)) { if (_attachment_is_shown($tags)) {
difference() { difference() {
@ -725,14 +730,14 @@ module diff(neg, keep)
// Module: intersect() // Module: intersect()
// Usage: // Usage:
// intersect(a, [keep=]) {...} // intersect(a, [keep=]) CHILDREN;
// intersect(a, b, [keep=]) {...} // intersect(a, b, [keep=]) CHILDREN;
// Topics: Attachments // Topics: Attachments
// See Also: tags(), recolor(), show(), hide(), diff() // See Also: tags(), recolor(), show(), hide(), diff()
// Description: // Description:
// If `a` is given, takes the union of all children with tags that are in `a`, and `intersection()`s // If `a` is given, takes the union of all children with tags that are in `a`, and intersects
// them with the union of all children with tags in `b`. If `b` is not given, then the union of all // them with the union of all children with tags in `b`. If `b` is not given, then the union of all
// items with tags in `a` are intersection()ed with the union of all items without tags in `a`. If // items with tags in `a` are intersected with the union of all items without tags in `a`. If
// `keep` is given, then the result is unioned with all the children with tags in `keep`. If `keep` // `keep` is given, then the result is unioned with all the children with tags in `keep`. If `keep`
// is not given, all children without tags in `a` or `b` are unioned with the result. // is not given, all children without tags in `a` or `b` are unioned with the result.
// Cannot be used in conjunction with `diff()` or `hulling()` on the same parent object. // Cannot be used in conjunction with `diff()` or `hulling()` on the same parent object.
@ -764,6 +769,7 @@ module diff(neg, keep)
// } // }
module intersect(a, b=undef, keep=undef) module intersect(a, b=undef, keep=undef)
{ {
req_children($children);
// Don't perform the operation if the current tags are hidden // Don't perform the operation if the current tags are hidden
if (_attachment_is_shown($tags)) { if (_attachment_is_shown($tags)) {
intersection() { intersection() {
@ -790,7 +796,7 @@ module intersect(a, b=undef, keep=undef)
// Module: hulling() // Module: hulling()
// Usage: // Usage:
// hulling(a) {...} // hulling(a) CHILDREN;
// Topics: Attachments // Topics: Attachments
// See Also: tags(), recolor(), show(), hide(), diff(), intersect() // See Also: tags(), recolor(), show(), hide(), diff(), intersect()
// Description: // Description:
@ -810,6 +816,7 @@ module intersect(a, b=undef, keep=undef)
// } // }
module hulling(a) module hulling(a)
{ {
req_children($children);
if (is_undef(a)) { if (is_undef(a)) {
hull() children(); hull() children();
} else { } else {
@ -821,7 +828,7 @@ module hulling(a)
// Module: hide() // Module: hide()
// Usage: // Usage:
// hide(tags) {...} // hide(tags) CHILDREN;
// Topics: Attachments // Topics: Attachments
// See Also: tags(), recolor(), show(), diff(), intersect() // See Also: tags(), recolor(), show(), diff(), intersect()
// Description: // Description:
@ -834,6 +841,7 @@ module hulling(a)
// } // }
module hide(tags="") module hide(tags="")
{ {
req_children($children);
$tags_hidden = tags==""? [] : str_split(tags, " "); $tags_hidden = tags==""? [] : str_split(tags, " ");
$tags_shown = []; $tags_shown = [];
children(); children();
@ -842,7 +850,7 @@ module hide(tags="")
// Module: show() // Module: show()
// Usage: // Usage:
// show(tags) {...} // show(tags) CHILDREN;
// Topics: Attachments // Topics: Attachments
// See Also: tags(), recolor(), hide(), diff(), intersect() // See Also: tags(), recolor(), hide(), diff(), intersect()
// Description: // Description:
@ -855,6 +863,7 @@ module hide(tags="")
// } // }
module show(tags="") module show(tags="")
{ {
req_children($children);
$tags_shown = tags==""? [] : str_split(tags, " "); $tags_shown = tags==""? [] : str_split(tags, " ");
$tags_hidden = []; $tags_hidden = [];
children(); children();
@ -867,7 +876,7 @@ module show(tags="")
// Module: edge_mask() // Module: edge_mask()
// Usage: // Usage:
// edge_mask([edges], [except]) {...} // edge_mask([edges], [except]) CHILDREN;
// Topics: Attachments // Topics: Attachments
// See Also: attachable(), position(), attach(), face_profile(), edge_profile(), corner_mask() // See Also: attachable(), position(), attach(), face_profile(), edge_profile(), corner_mask()
// Description: // Description:
@ -895,6 +904,7 @@ module show(tags="")
// edge_mask([TOP,"Z"],except=[BACK,TOP+LEFT]) // edge_mask([TOP,"Z"],except=[BACK,TOP+LEFT])
// rounding_edge_mask(l=71,r=10); // rounding_edge_mask(l=71,r=10);
module edge_mask(edges=EDGES_ALL, except=[]) { module edge_mask(edges=EDGES_ALL, except=[]) {
req_children($children);
assert($parent_geom != undef, "No object to attach to!"); assert($parent_geom != undef, "No object to attach to!");
edges = _edges(edges, except=except); edges = _edges(edges, except=except);
vecs = [ vecs = [
@ -922,7 +932,7 @@ module edge_mask(edges=EDGES_ALL, except=[]) {
// Module: corner_mask() // Module: corner_mask()
// Usage: // Usage:
// corner_mask([corners], [except]) {...} // corner_mask([corners], [except]) CHILDREN;
// Topics: Attachments // Topics: Attachments
// See Also: attachable(), position(), attach(), face_profile(), edge_profile(), edge_mask() // See Also: attachable(), position(), attach(), face_profile(), edge_profile(), edge_mask()
// Description: // Description:
@ -944,6 +954,7 @@ module edge_mask(edges=EDGES_ALL, except=[]) {
// translate([20,20,20]) sphere(r=20); // translate([20,20,20]) sphere(r=20);
// } // }
module corner_mask(corners=CORNERS_ALL, except=[]) { module corner_mask(corners=CORNERS_ALL, except=[]) {
req_children($children);
assert($parent_geom != undef, "No object to attach to!"); assert($parent_geom != undef, "No object to attach to!");
corners = _corners(corners, except=except); corners = _corners(corners, except=except);
vecs = [for (i = [0:7]) if (corners[i]>0) CORNER_OFFSETS[i]]; vecs = [for (i = [0:7]) if (corners[i]>0) CORNER_OFFSETS[i]];
@ -965,7 +976,7 @@ module corner_mask(corners=CORNERS_ALL, except=[]) {
// Module: face_profile() // Module: face_profile()
// Usage: // Usage:
// face_profile(faces, r|d=, [convexity=]) {...} // face_profile(faces, r|d=, [convexity=]) CHILDREN;
// Topics: Attachments // Topics: Attachments
// See Also: attachable(), position(), attach(), edge_profile(), corner_profile() // See Also: attachable(), position(), attach(), edge_profile(), corner_profile()
// Description: // Description:
@ -986,6 +997,7 @@ module corner_mask(corners=CORNERS_ALL, except=[]) {
// face_profile(TOP,r=10) // face_profile(TOP,r=10)
// mask2d_roundover(r=10); // mask2d_roundover(r=10);
module face_profile(faces=[], r, d, convexity=10) { module face_profile(faces=[], r, d, convexity=10) {
req_children($children);
faces = is_vector(faces)? [faces] : faces; faces = is_vector(faces)? [faces] : faces;
assert(all([for (face=faces) is_vector(face) && sum([for (x=face) x!=0? 1 : 0])==1]), "Vector in faces doesn't point at a face."); assert(all([for (face=faces) is_vector(face) && sum([for (x=face) x!=0? 1 : 0])==1]), "Vector in faces doesn't point at a face.");
r = get_radius(r=r, d=d, dflt=undef); r = get_radius(r=r, d=d, dflt=undef);
@ -997,7 +1009,7 @@ module face_profile(faces=[], r, d, convexity=10) {
// Module: edge_profile() // Module: edge_profile()
// Usage: // Usage:
// edge_profile([edges], [except], [convexity]) {...} // edge_profile([edges], [except], [convexity]) CHILDREN;
// Topics: Attachments // Topics: Attachments
// See Also: attachable(), position(), attach(), face_profile(), corner_profile() // See Also: attachable(), position(), attach(), face_profile(), corner_profile()
// Description: // Description:
@ -1018,6 +1030,7 @@ module face_profile(faces=[], r, d, convexity=10) {
// edge_profile([TOP,"Z"],except=[BACK,TOP+LEFT]) // edge_profile([TOP,"Z"],except=[BACK,TOP+LEFT])
// mask2d_roundover(r=10, inset=2); // mask2d_roundover(r=10, inset=2);
module edge_profile(edges=EDGES_ALL, except=[], convexity=10) { module edge_profile(edges=EDGES_ALL, except=[], convexity=10) {
req_children($children);
assert($parent_geom != undef, "No object to attach to!"); assert($parent_geom != undef, "No object to attach to!");
edges = _edges(edges, except=except); edges = _edges(edges, except=except);
vecs = [ vecs = [
@ -1052,7 +1065,7 @@ module edge_profile(edges=EDGES_ALL, except=[], convexity=10) {
// Module: corner_profile() // Module: corner_profile()
// Usage: // Usage:
// corner_profile([corners], [except], <r=|d=>, [convexity=]) {...} // corner_profile([corners], [except], [r=|d=], [convexity=]) CHILDREN;
// Topics: Attachments // Topics: Attachments
// See Also: attachable(), position(), attach(), face_profile(), edge_profile() // See Also: attachable(), position(), attach(), face_profile(), edge_profile()
// Description: // Description:
@ -1121,33 +1134,33 @@ module corner_profile(corners=CORNERS_ALL, except=[], r, d, convexity=10) {
// Module: attachable() // Module: attachable()
// //
// Usage: Square/Trapezoid Geometry // Usage: Square/Trapezoid Geometry
// attachable(anchor, spin, two_d=true, size=, [size2=], [shift=], ...) {...} // attachable(anchor, spin, two_d=true, size=, [size2=], [shift=], ...) {OBJECT; children();}
// Usage: Circle/Oval Geometry // Usage: Circle/Oval Geometry
// attachable(anchor, spin, two_d=true, r=|d=, ...) {...} // attachable(anchor, spin, two_d=true, r=|d=, ...) {OBJECT; children();}
// Usage: 2D Path/Polygon Geometry // Usage: 2D Path/Polygon Geometry
// attachable(anchor, spin, two_d=true, path=, [extent=], ...) {...} // attachable(anchor, spin, two_d=true, path=, [extent=], ...) {OBJECT; children();}
// Usage: 2D Region Geometry // Usage: 2D Region Geometry
// attachable(anchor, spin, two_d=true, region=, [extent=], ...) {...} // attachable(anchor, spin, two_d=true, region=, [extent=], ...) {OBJECT; children();}
// Usage: Cubical/Prismoidal Geometry // Usage: Cubical/Prismoidal Geometry
// attachable(anchor, spin, [orient], size=, [size2=], [shift=], ...) {...} // attachable(anchor, spin, [orient], size=, [size2=], [shift=], ...) {OBJECT; children();}
// Usage: Cylindrical Geometry // Usage: Cylindrical Geometry
// attachable(anchor, spin, [orient], r=|d=, l=, [axis=], ...) {...} // attachable(anchor, spin, [orient], r=|d=, l=, [axis=], ...) {OBJECT; children();}
// Usage: Conical Geometry // Usage: Conical Geometry
// attachable(anchor, spin, [orient], r1=|d1=, r2=|d2=, l=, [axis=], ...) {...} // attachable(anchor, spin, [orient], r1=|d1=, r2=|d2=, l=, [axis=], ...) {OBJECT; children();}
// Usage: Spheroid/Ovoid Geometry // Usage: Spheroid/Ovoid Geometry
// attachable(anchor, spin, [orient], r=|d=, ...) {...} // attachable(anchor, spin, [orient], r=|d=, ...) {OBJECT; children();}
// Usage: Extruded Path/Polygon Geometry // Usage: Extruded Path/Polygon Geometry
// attachable(anchor, spin, path=, l=|h=, [extent=], ...) {...} // attachable(anchor, spin, path=, l=|h=, [extent=], ...) {OBJECT; children();}
// Usage: Extruded Region Geometry // Usage: Extruded Region Geometry
// attachable(anchor, spin, region=, l=|h=, [extent=], ...) {...} // attachable(anchor, spin, region=, l=|h=, [extent=], ...) {OBJECT; children();}
// Usage: VNF Geometry // Usage: VNF Geometry
// attachable(anchor, spin, [orient], vnf=, [extent=], ...) {...} // attachable(anchor, spin, [orient], vnf=, [extent=], ...) {OBJECT; children();}
// //
// Topics: Attachments // Topics: Attachments
// See Also: reorient() // See Also: reorient()
// //
// Description: // Description:
// Manages the anchoring, spin, orientation, and attachments for a 3D volume or 2D area. // Manages the anchoring, spin, orientation, and attachments for OBJECT, located in a 3D volume or 2D area.
// A managed 3D volume is assumed to be vertically (Z-axis) oriented, and centered. // A managed 3D volume is assumed to be vertically (Z-axis) oriented, and centered.
// A managed 2D area is just assumed to be centered. The shape to be managed is given // A managed 2D area is just assumed to be centered. The shape to be managed is given
// as the first child to this module, and the second child should be given as `children()`. // as the first child to this module, and the second child should be given as `children()`.

View file

@ -371,7 +371,7 @@ function bezier_length(bezier, start_u=0, end_u=1, max_deflect=0.01) =
// Function: bezier_line_intersection() // Function: bezier_line_intersection()
// Usage: // Usage:
// u = bezier_line_intersection(curve, line); // u = bezier_line_intersection(bezier, line);
// Topics: Bezier Curves, Geometry, Intersection // Topics: Bezier Curves, Geometry, Intersection
// See Also: bezier_points(), bezier_length(), bezier_closest_point() // See Also: bezier_points(), bezier_length(), bezier_closest_point()
// Description: // Description:
@ -708,6 +708,7 @@ function bezpath_offset(offset, bezier, N=3) =
// pt = The starting endpoint for the bezier path. // pt = The starting endpoint for the bezier path.
// a = If given a scalar, specifies the theta (XY plane) angle in degrees from X+. If given a vector, specifies the direction and possibly distance of the first control point. // a = If given a scalar, specifies the theta (XY plane) angle in degrees from X+. If given a vector, specifies the direction and possibly distance of the first control point.
// r = Specifies the distance of the control point from the endpoint `pt`. // r = Specifies the distance of the control point from the endpoint `pt`.
// ---
// p = If given, specifies the number of degrees away from the Z+ axis. // p = If given, specifies the number of degrees away from the Z+ axis.
// Example(2D): 2D Bezier Path by Angle // Example(2D): 2D Bezier Path by Angle
// bezpath = flatten([ // bezpath = flatten([
@ -781,6 +782,7 @@ function bez_begin(pt,a,r,p) =
// a = If given a scalar, specifies the theta (XY plane) angle in degrees from X+. If given a vector, specifies the direction and possibly distance of the departing control point. // a = If given a scalar, specifies the theta (XY plane) angle in degrees from X+. If given a vector, specifies the direction and possibly distance of the departing control point.
// r1 = Specifies the distance of the approching control point from the fixed point. Overrides the distance component of the vector if `a` contains a vector. // r1 = Specifies the distance of the approching control point from the fixed point. Overrides the distance component of the vector if `a` contains a vector.
// r2 = Specifies the distance of the departing control point from the fixed point. Overrides the distance component of the vector if `a` contains a vector. If `r1` is given and `r2` is not, uses the value of `r1` for `r2`. // r2 = Specifies the distance of the departing control point from the fixed point. Overrides the distance component of the vector if `a` contains a vector. If `r1` is given and `r2` is not, uses the value of `r1` for `r2`.
// ---
// p = If given, specifies the number of degrees away from the Z+ axis. // p = If given, specifies the number of degrees away from the Z+ axis.
function bez_tang(pt,a,r1,r2,p) = function bez_tang(pt,a,r1,r2,p) =
assert(is_finite(r1) || is_vector(a)) assert(is_finite(r1) || is_vector(a))
@ -816,6 +818,7 @@ function bez_tang(pt,a,r1,r2,p) =
// a2 = If given a scalar, specifies the theta (XY plane) angle in degrees from X+. If given a vector, specifies the direction and possibly distance of the departing control point. // a2 = If given a scalar, specifies the theta (XY plane) angle in degrees from X+. If given a vector, specifies the direction and possibly distance of the departing control point.
// r1 = Specifies the distance of the approching control point from the fixed point. Overrides the distance component of the vector if `a1` contains a vector. // r1 = Specifies the distance of the approching control point from the fixed point. Overrides the distance component of the vector if `a1` contains a vector.
// r2 = Specifies the distance of the departing control point from the fixed point. Overrides the distance component of the vector if `a2` contains a vector. // r2 = Specifies the distance of the departing control point from the fixed point. Overrides the distance component of the vector if `a2` contains a vector.
// ---
// p1 = If given, specifies the number of degrees away from the Z+ axis of the approaching control point. // p1 = If given, specifies the number of degrees away from the Z+ axis of the approaching control point.
// p2 = If given, specifies the number of degrees away from the Z+ axis of the departing control point. // p2 = If given, specifies the number of degrees away from the Z+ axis of the departing control point.
function bez_joint(pt,a1,a2,r1,r2,p1,p2) = function bez_joint(pt,a1,a2,r1,r2,p1,p2) =

View file

@ -15,7 +15,7 @@ use <builtins.scad>
// Module: recolor() // Module: recolor()
// Usage: // Usage:
// recolor([c]) children; // recolor([c]) CHILDREN;
// Topics: Attachments // Topics: Attachments
// See Also: color_this() // See Also: color_this()
// Description: // Description:
@ -42,7 +42,7 @@ module recolor(c="default")
// Module: color_this() // Module: color_this()
// Usage: // Usage:
// color_this([c]) children; // color_this([c]) CHILDREN;
// Topics: Attachments // Topics: Attachments
// See Also: recolor() // See Also: recolor()
// Description: // Description:
@ -71,7 +71,7 @@ module color_this(c="default")
// Module: rainbow() // Module: rainbow()
// Usage: // Usage:
// rainbow(list,[stride],[maxhues],[shuffle],[seed]) children; // rainbow(list,[stride],[maxhues],[shuffle],[seed]) CHILDREN;
// Description: // Description:
// Iterates the list, displaying children in different colors for each list item. The color // Iterates the list, displaying children in different colors for each list item. The color
// is set using the color() module, so this module is not compatible with {{recolor()}} or // is set using the color() module, so this module is not compatible with {{recolor()}} or
@ -110,7 +110,7 @@ module rainbow(list, stride=1, maxhues, shuffle=false, seed)
// Function&Module: hsl() // Function&Module: hsl()
// Usage: // Usage:
// hsl(h,[s],[l],[a]) children; // hsl(h,[s],[l],[a]) CHILDREN;
// rgb = hsl(h,[s],[l],[a]); // rgb = hsl(h,[s],[l],[a]);
// Description: // Description:
// When called as a function, returns the [R,G,B] color for the given hue `h`, saturation `s`, and lightness `l` from the HSL colorspace. If you supply // When called as a function, returns the [R,G,B] color for the given hue `h`, saturation `s`, and lightness `l` from the HSL colorspace. If you supply
@ -145,7 +145,7 @@ module hsl(h,s=1,l=0.5,a=1)
// Function&Module: hsv() // Function&Module: hsv()
// Usage: // Usage:
// hsv(h,[s],[v],[a]) children; // hsv(h,[s],[v],[a]) CHILDREN;
// rgb = hsv(h,[s],[v],[a]); // rgb = hsv(h,[s],[v],[a]);
// Description: // Description:
// When called as a function, returns the [R,G,B] color for the given hue `h`, saturation `s`, and value `v` from the HSV colorspace. If you supply // When called as a function, returns the [R,G,B] color for the given hue `h`, saturation `s`, and value `v` from the HSV colorspace. If you supply

View file

@ -534,9 +534,9 @@ module stroke(
// Function&Module: dashed_stroke() // Function&Module: dashed_stroke()
// Usage: As a Module // Usage: As a Module
// dashed_stroke(path, dashpat, [closed=]); // dashed_stroke(path, dashpat, [width=], [closed=]);
// Usage: As a Function // Usage: As a Function
// dashes = dashed_stroke(path, dashpat, width=, [closed=]); // dashes = dashed_stroke(path, dashpat, [closed=]);
// Topics: Paths, Drawing Tools // Topics: Paths, Drawing Tools
// See Also: stroke(), path_cut() // See Also: stroke(), path_cut()
// Description: // Description:
@ -595,17 +595,19 @@ module dashed_stroke(path, dashpat=[3,3], width=1, closed=false) {
// Function&Module: arc() // Function&Module: arc()
// Usage: 2D arc from 0º to `angle` degrees. // Usage: 2D arc from 0º to `angle` degrees.
// arc(n, r|d=, angle); // path=arc(n, r|d=, angle);
// Usage: 2D arc from START to END degrees. // Usage: 2D arc from START to END degrees.
// arc(n, r|d=, angle=[START,END]) // path=arc(n, r|d=, angle=[START,END]);
// Usage: 2D arc from `start` to `start+angle` degrees. // Usage: 2D arc from `start` to `start+angle` degrees.
// arc(n, r|d=, start=, angle=) // path=arc(n, r|d=, start=, angle=);
// Usage: 2D circle segment by `width` and `thickness`, starting and ending on the X axis. // Usage: 2D circle segment by `width` and `thickness`, starting and ending on the X axis.
// arc(n, width=, thickness=) // path=arc(n, width=, thickness=);
// Usage: Shortest 2D or 3D arc around centerpoint `cp`, starting at P0 and ending on the vector pointing from `cp` to `P1`. // Usage: Shortest 2D or 3D arc around centerpoint `cp`, starting at P0 and ending on the vector pointing from `cp` to `P1`.
// arc(n, cp=, points=[P0,P1], [long=], [cw=], [ccw=]) // path=arc(n, cp=, points=[P0,P1], [long=], [cw=], [ccw=]);
// Usage: 2D or 3D arc, starting at `P0`, passing through `P1` and ending at `P2`. // Usage: 2D or 3D arc, starting at `P0`, passing through `P1` and ending at `P2`.
// arc(n, points=[P0,P1,P2]) // path=arc(n, points=[P0,P1,P2]);
// Usage: as module
// arc(...) [ATTACHMENTS];
// Topics: Paths (2D), Paths (3D), Shapes (2D), Path Generators // Topics: Paths (2D), Paths (3D), Shapes (2D), Path Generators
// Description: // Description:
// If called as a function, returns a 2D or 3D path forming an arc. // If called as a function, returns a 2D or 3D path forming an arc.
@ -742,7 +744,7 @@ module arc(n, r, angle, d, cp, points, width, thickness, start, wedge=false, anc
// Function: helix() // Function: helix()
// Usage: // Usage:
// helix([l|h], [turns], [angle], r|r1|r2, d|d1|d2) // path = helix(l|h, [turns=], [angle=], r=|r1=|r2=, d=|d1=|d2=);
// Description: // Description:
// Returns a 3D helical path on a cone, including the degerate case of flat spirals. // Returns a 3D helical path on a cone, including the degerate case of flat spirals.
// You can specify start and end radii. You can give the length, the helix angle, or the number of turns: two // You can specify start and end radii. You can give the length, the helix angle, or the number of turns: two

View file

@ -281,7 +281,7 @@ function force_region(poly) = is_path(poly) ? [poly] : poly;
// Module: region() // Module: region()
// Usage: // Usage:
// region(r, [anchor], [spin=], [cp=], [atype=]) [attachments]; // region(r, [anchor], [spin=], [cp=], [atype=]) [ATTACHMENTS];
// Description: // Description:
// Creates the 2D polygons described by the given region or list of polygons. This module works on // Creates the 2D polygons described by the given region or list of polygons. This module works on
// arbitrary lists of polygons that cross each other and hence do not define a valid region. The // arbitrary lists of polygons that cross each other and hence do not define a valid region. The
@ -983,7 +983,7 @@ function _list_three(a,b,c) =
// Function&Module: union() // Function&Module: union()
// Usage: // Usage:
// union() children; // union() CHILDREN;
// region = union(regions); // region = union(regions);
// region = union(REGION1,REGION2); // region = union(REGION1,REGION2);
// region = union(REGION1,REGION2,REGION3); // region = union(REGION1,REGION2,REGION3);
@ -1013,7 +1013,7 @@ function union(regions=[],b=undef,c=undef,eps=EPSILON) =
// Function&Module: difference() // Function&Module: difference()
// Usage: // Usage:
// difference() children; // difference() CHILDREN;
// region = difference(regions); // region = difference(regions);
// region = difference(REGION1,REGION2); // region = difference(REGION1,REGION2);
// region = difference(REGION1,REGION2,REGION3); // region = difference(REGION1,REGION2,REGION3);
@ -1045,7 +1045,7 @@ function difference(regions=[],b=undef,c=undef,eps=EPSILON) =
// Function&Module: intersection() // Function&Module: intersection()
// Usage: // Usage:
// intersection() children; // intersection() CHILDREN;
// region = intersection(regions); // region = intersection(regions);
// region = intersection(REGION1,REGION2); // region = intersection(REGION1,REGION2);
// region = intersection(REGION1,REGION2,REGION3); // region = intersection(REGION1,REGION2,REGION3);
@ -1076,7 +1076,7 @@ function intersection(regions=[],b=undef,c=undef,eps=EPSILON) =
// Function&Module: exclusive_or() // Function&Module: exclusive_or()
// Usage: // Usage:
// exclusive_or() children; // exclusive_or() CHILDREN;
// region = exclusive_or(regions); // region = exclusive_or(regions);
// region = exclusive_or(REGION1,REGION2); // region = exclusive_or(REGION1,REGION2);
// region = exclusive_or(REGION1,REGION2,REGION3); // region = exclusive_or(REGION1,REGION2,REGION3);

View file

@ -1241,7 +1241,7 @@ module offset_stroke(path, width=1, rounded=true, start, end, check_valid=true,
// Function&Module: offset_sweep() // Function&Module: offset_sweep()
// Usage: most common module arguments. See Arguments list below for more. // Usage: most common module arguments. See Arguments list below for more.
// offset_sweep(path, [height|length|h|l|], [bottom], [top], [offset=], [convexity=],...) {attachments}; // offset_sweep(path, [height|length|h|l|], [bottom], [top], [offset=], [convexity=],...) [ATTACHMENTS];
// Usage: most common function arguments. See Arguments list below for more. // Usage: most common function arguments. See Arguments list below for more.
// vnf = offset_sweep(path, [height|h|l|length], [bottom], [top], [offset=], ...); // vnf = offset_sweep(path, [height|h|l|length], [bottom], [top], [offset=], ...);
// Description: // Description:
@ -1707,7 +1707,7 @@ function os_mask(mask, out=false, extra,check_valid, quality, offset) =
// Module: convex_offset_extrude() // Module: convex_offset_extrude()
// Usage: Basic usage. See below for full options // Usage: Basic usage. See below for full options
// convex_offset_extrude(height, [bottom], [top], ...) 2D-children; // convex_offset_extrude(height, [bottom], [top], ...) 2D-CHILDREN;
// Description: // Description:
// Extrudes 2d children with layers formed from the convex hull of the offset of each child according to a sequence of offset values. // Extrudes 2d children with layers formed from the convex hull of the offset of each child according to a sequence of offset values.
// Like `offset_sweep` this module can use built-in offset profiles to provide treatments such as roundovers or chamfers but unlike `offset_sweep()` it // Like `offset_sweep` this module can use built-in offset profiles to provide treatments such as roundovers or chamfers but unlike `offset_sweep()` it
@ -1939,7 +1939,7 @@ function _rp_compute_patches(top, bot, rtop, rsides, ktop, ksides, concave) =
// Function&Module: rounded_prism() // Function&Module: rounded_prism()
// Usage: as a module // Usage: as a module
// rounded_prism(bottom, [top], [height=|h=|length=|l=], [joint_top=], [joint_bot=], [joint_sides=], [k=], [k_top=], [k_bot=], [k_sides=], [splinesteps=], [debug=], [convexity=],...) {attachments}; // rounded_prism(bottom, [top], [height=|h=|length=|l=], [joint_top=], [joint_bot=], [joint_sides=], [k=], [k_top=], [k_bot=], [k_sides=], [splinesteps=], [debug=], [convexity=],...) [ATTACHMENTS];
// Usage: as a function // Usage: as a function
// vnf = rounded_prism(bottom, [top], [height=|h=|length=|l=], [joint_top=], [joint_bot=], [joint_sides=], [k=], [k_top=], [k_bot=], [k_sides=], [splinesteps=], [debug=]); // vnf = rounded_prism(bottom, [top], [height=|h=|length=|l=], [joint_top=], [joint_bot=], [joint_sides=], [k=], [k_top=], [k_bot=], [k_sides=], [splinesteps=], [debug=]);
// Description: // Description:
@ -2476,8 +2476,8 @@ Access to the derivative smoothing parameter?
// Function&Module: join_prism() // Function&Module: join_prism()
// Usage: The two main forms with most common options // Usage: The two main forms with most common options
// join_prism(polygon, base, length=|height=|l=|h=, fillet=, [base_T=], [scale=], [prism_end_T=], [short=], ...) {attachments}; // join_prism(polygon, base, length=|height=|l=|h=, fillet=, [base_T=], [scale=], [prism_end_T=], [short=], ...) [ATTACHMENTS];
// join_prism(polygon, base, aux=, fillet=, [base_T=], [aux_T=], [scale=], [prism_end_T=], [short=], ...) {attachments}; // join_prism(polygon, base, aux=, fillet=, [base_T=], [aux_T=], [scale=], [prism_end_T=], [short=], ...) [ATTACHMENTS];
// Usage: As function // Usage: As function
// vnf = join_prism( ... ); // vnf = join_prism( ... );
// Description: // Description:

View file

@ -25,7 +25,7 @@ use <builtins.scad>
// Usage: As a Module // Usage: As a Module
// square(size, [center], ...); // square(size, [center], ...);
// Usage: With Attachments // Usage: With Attachments
// square(size, [center], ...) { attachables } // square(size, [center], ...) [ATTACHMENTS];
// Usage: As a Function // Usage: As a Function
// path = square(size, [center], ...); // path = square(size, [center], ...);
// See Also: rect() // See Also: rect()
@ -72,9 +72,7 @@ module square(size=1, center, anchor, spin) {
// Function&Module: rect() // Function&Module: rect()
// Usage: As Module // Usage: As Module
// rect(size, [rounding], [chamfer], ...); // rect(size, [rounding], [chamfer], ...) [ATTACHMENTS];
// Usage: With Attachments
// rect(size, ...) { attachables }
// Usage: As Function // Usage: As Function
// path = rect(size, [rounding], [chamfer], ...); // path = rect(size, [rounding], [chamfer], ...);
// Topics: Shapes (2D), Paths (2D), Path Generators, Attachable // Topics: Shapes (2D), Paths (2D), Path Generators, Attachable
@ -205,9 +203,7 @@ function rect(size=1, rounding=0, chamfer=0, atype="box", anchor=CENTER, spin=0)
// Function&Module: circle() // Function&Module: circle()
// Topics: Shapes (2D), Path Generators (2D) // Topics: Shapes (2D), Path Generators (2D)
// Usage: As a Module // Usage: As a Module
// circle(r|d=, ...); // circle(r|d=, ...) [ATTACHMENTS];
// Usage: With Attachments
// circle(r|d=, ...) { attachables }
// Usage: As a Function // Usage: As a Function
// path = circle(r|d=, ...); // path = circle(r|d=, ...);
// See Also: ellipse(), circle_2tangents(), circle_3points() // See Also: ellipse(), circle_2tangents(), circle_3points()
@ -245,9 +241,7 @@ module circle(r, d, anchor=CENTER, spin=0) {
// Function&Module: ellipse() // Function&Module: ellipse()
// Usage: As a Module // Usage: As a Module
// ellipse(r|d=, [realign=], [circum=], ...); // ellipse(r|d=, [realign=], [circum=], ...) [ATTACHMENTS];
// Usage: With Attachments
// ellipse(r|d=, [realign=], [circum=], ...) { attachables }
// Usage: As a Function // Usage: As a Function
// path = ellipse(r|d=, [realign=], [circum=], ...); // path = ellipse(r|d=, [realign=], [circum=], ...);
// Topics: Shapes (2D), Paths (2D), Path Generators, Attachable // Topics: Shapes (2D), Paths (2D), Path Generators, Attachable
@ -427,9 +421,9 @@ function ellipse(r, d, realign=false, circum=false, uniform=false, anchor=CENTER
// Function&Module: regular_ngon() // Function&Module: regular_ngon()
// Usage: // Usage:
// regular_ngon(n, r/d=/or=/od=, [realign=]); // regular_ngon(n, r|d=|or=|od=, [realign=]) [ATTACHMENTS];
// regular_ngon(n, ir=/id=, [realign=]); // regular_ngon(n, ir=|id=, [realign=]) [ATTACHMENTS];
// regular_ngon(n, side=, [realign=]); // regular_ngon(n, side=, [realign=]) [ATTACHMENTS];
// Topics: Shapes (2D), Paths (2D), Path Generators, Attachable // Topics: Shapes (2D), Paths (2D), Path Generators, Attachable
// See Also: circle(), pentagon(), hexagon(), octagon(), ellipse(), star() // See Also: circle(), pentagon(), hexagon(), octagon(), ellipse(), star()
// Description: // Description:
@ -563,9 +557,11 @@ module regular_ngon(n=6, r, d, or, od, ir, id, side, rounding=0, realign=false,
// Function&Module: pentagon() // Function&Module: pentagon()
// Usage: // Usage:
// pentagon(or|od=, [realign=]); // pentagon(or|od=, [realign=], [align_tip=|align_side=]) [ATTACHMENTS];
// pentagon(ir=|id=, [realign=]); // pentagon(ir=|id=, [realign=], [align_tip=|align_side=]) [ATTACHMENTS];
// pentagon(side=, [realign=]); // pentagon(side=, [realign=], [align_tip=|align_side=]) [ATTACHMENTS];
// Usage: as function
// path = pentagon(...);
// Topics: Shapes (2D), Paths (2D), Path Generators, Attachable // Topics: Shapes (2D), Paths (2D), Path Generators, Attachable
// See Also: circle(), regular_ngon(), hexagon(), octagon(), ellipse(), star() // See Also: circle(), regular_ngon(), hexagon(), octagon(), ellipse(), star()
// Description: // Description:
@ -619,17 +615,12 @@ module pentagon(r, d, or, od, ir, id, side, rounding=0, realign=false, align_tip
// Function&Module: hexagon() // Function&Module: hexagon()
// Usage: As Module // Usage: As Module
// hexagon(r/or, [realign=], <align_tip=|align_side=>, [rounding=], ...); // hexagon(r/or, [realign=], <align_tip=|align_side=>, [rounding=], ...) [ATTACHMENTS];
// hexagon(d=/od=, ...); // hexagon(d=/od=, ...) [ATTACHMENTS];
// hexagon(ir=/id=, ...); // hexagon(ir=/id=, ...) [ATTACHMENTS];
// hexagon(side=, ...); // hexagon(side=, ...) [ATTACHMENTS];
// Usage: With Attachments
// hexagon(r/or, ...) { attachments }
// Usage: As Function // Usage: As Function
// path = hexagon(r/or, ...); // path = hexagon(...);
// path = hexagon(d=/od=, ...);
// path = hexagon(ir=/id=, ...);
// path = hexagon(side=, ...);
// Topics: Shapes (2D), Paths (2D), Path Generators, Attachable // Topics: Shapes (2D), Paths (2D), Path Generators, Attachable
// See Also: circle(), regular_ngon(), pentagon(), octagon(), ellipse(), star() // See Also: circle(), regular_ngon(), pentagon(), octagon(), ellipse(), star()
// Description: // Description:
@ -683,17 +674,12 @@ module hexagon(r, d, or, od, ir, id, side, rounding=0, realign=false, align_tip,
// Function&Module: octagon() // Function&Module: octagon()
// Usage: As Module // Usage: As Module
// octagon(r/or, [realign=], <align_tip=|align_side=>, [rounding=], ...); // octagon(r/or, [realign=], [align_tip=|align_side=], [rounding=], ...) [ATTACHMENTS];
// octagon(d=/od=, ...); // octagon(d=/od=, ...) [ATTACHMENTS];
// octagon(ir=/id=, ...); // octagon(ir=/id=, ...) [ATTACHMENTS];
// octagon(side=, ...); // octagon(side=, ...) [ATTACHMENTS];
// Usage: With Attachments
// octagon(r/or, ...) { attachments }
// Usage: As Function // Usage: As Function
// path = octagon(r/or, ...); // path = octagon(...);
// path = octagon(d=/od=, ...);
// path = octagon(ir=/id=, ...);
// path = octagon(side=, ...);
// Topics: Shapes (2D), Paths (2D), Path Generators, Attachable // Topics: Shapes (2D), Paths (2D), Path Generators, Attachable
// See Also: circle(), regular_ngon(), pentagon(), hexagon(), ellipse(), star() // See Also: circle(), regular_ngon(), pentagon(), hexagon(), ellipse(), star()
// Description: // Description:
@ -746,9 +732,7 @@ module octagon(r, d, or, od, ir, id, side, rounding=0, realign=false, align_tip,
// Function&Module: right_triangle() // Function&Module: right_triangle()
// Usage: As Module // Usage: As Module
// right_triangle(size, [center], ...); // right_triangle(size, [center], ...) [ATTACHMENTS];
// Usage: With Attachments
// right_triangle(size, [center], ...) { attachments }
// Usage: As Function // Usage: As Function
// path = right_triangle(size, [center], ...); // path = right_triangle(size, [center], ...);
// Description: // Description:
@ -790,17 +774,12 @@ module right_triangle(size=[1,1], center, anchor, spin=0) {
// Function&Module: trapezoid() // Function&Module: trapezoid()
// Usage: As Module // Usage: As Module
// trapezoid(h, w1, w2, [shift=], [rounding=], [chamfer=], ...); // trapezoid(h, w1, w2, [shift=], [rounding=], [chamfer=], ...) [ATTACHMENTS];
// trapezoid(h, w1, angle=, ...); // trapezoid(h, w1, angle=, ...) [ATTACHMENTS];
// trapezoid(h, w2, angle=, ...); // trapezoid(h, w2, angle=, ...) [ATTACHMENTS];
// trapezoid(w1, w2, angle=, ...); // trapezoid(w1, w2, angle=, ...) [ATTACHMENTS];
// Usage: With Attachments
// trapezoid(h, w1, w2, ...) { attachments }
// Usage: As Function // Usage: As Function
// path = trapezoid(h, w1, w2, ...); // path = trapezoid(...);
// path = trapezoid(h, w1, angle=, ...);
// path = trapezoid(h, w2=, angle=, ...);
// path = trapezoid(w1=, w2=, angle=, ...);
// Topics: Shapes (2D), Paths (2D), Path Generators, Attachable // Topics: Shapes (2D), Paths (2D), Path Generators, Attachable
// See Also: rect(), square() // See Also: rect(), square()
// Description: // Description:
@ -947,10 +926,8 @@ module trapezoid(h, w1, w2, angle, shift=0, chamfer=0, rounding=0, flip=false, a
// Function&Module: star() // Function&Module: star()
// Usage: As Module // Usage: As Module
// star(n, r/or, ir, [realign=], [align_tip=], [align_pit=], ...); // star(n, r/or, ir, [realign=], [align_tip=], [align_pit=], ...) [ATTACHMENTS];
// star(n, r/or, step=, ...); // star(n, r/or, step=, ...) [ATTACHMENTS];
// Usage: With Attachments
// star(n, r/or, ir, ...) { attachments }
// Usage: As Function // Usage: As Function
// path = star(n, r/or, ir, [realign=], [align_tip=], [align_pit=], ...); // path = star(n, r/or, ir, [realign=], [align_tip=], [align_pit=], ...);
// path = star(n, r/or, step=, ...); // path = star(n, r/or, step=, ...);
@ -1132,11 +1109,11 @@ function _path_add_jitter(path, dist=1/512, closed=true) =
// linear_extrude(height=h, twist=72, slices=h/quadsize) // linear_extrude(height=h, twist=72, slices=h/quadsize)
// jittered_poly(spath); // jittered_poly(spath);
module jittered_poly(path, dist=1/512) { module jittered_poly(path, dist=1/512) {
no_children($children);
polygon(_path_add_jitter(path, dist, closed=true)); polygon(_path_add_jitter(path, dist, closed=true));
} }
// Section: Curved 2D Shapes // Section: Curved 2D Shapes
@ -1146,9 +1123,7 @@ module jittered_poly(path, dist=1/512) {
// Makes a 2D teardrop shape. Useful for extruding into 3D printable holes. Uses "intersect" style anchoring. // Makes a 2D teardrop shape. Useful for extruding into 3D printable holes. Uses "intersect" style anchoring.
// //
// Usage: As Module // Usage: As Module
// teardrop2d(r/d=, [ang], [cap_h]); // teardrop2d(r/d=, [ang], [cap_h]) [ATTACHMENTS];
// Usage: With Attachments
// teardrop2d(r/d=, [ang], [cap_h], ...) { attachments }
// Usage: As Function // Usage: As Function
// path = teardrop2d(r/d=, [ang], [cap_h]); // path = teardrop2d(r/d=, [ang], [cap_h]);
// //
@ -1200,9 +1175,9 @@ function teardrop2d(r, ang=45, cap_h, d, anchor=CENTER, spin=0) =
// Function&Module: egg() // Function&Module: egg()
// Usage: As Module // Usage: As Module
// egg(length, r1, r2, R); // egg(length, r1|d1=, r2|d2=, R|D=) [ATTACHMENTS];
// Usage: As Function // Usage: As Function
// path = egg(length, r1|d2, r2|d2, R|D); // path = egg(length, r1|d1=, r2|d2=, R|D=);
// Topics: Shapes (2D), Paths (2D), Path Generators, Attachable // Topics: Shapes (2D), Paths (2D), Path Generators, Attachable
// See Also: circle(), ellipse(), glued_circles() // See Also: circle(), ellipse(), glued_circles()
// Description: // Description:
@ -1287,11 +1262,9 @@ module egg(length,r1,r2,R,d1,d2,D,anchor=CENTER, spin=0)
// Function&Module: glued_circles() // Function&Module: glued_circles()
// Usage: As Module // Usage: As Module
// glued_circles(r/d=, [spread=], [tangent=], ...); // glued_circles(r/d=, [spread], [tangent], ...) [ATTACHMENTS];
// Usage: With Attachments
// glued_circles(r/d=, [spread=], [tangent=], ...) { attachments }
// Usage: As Function // Usage: As Function
// path = glued_circles(r/d=, [spread=], [tangent=], ...); // path = glued_circles(r/d=, [spread], [tangent], ...);
// Topics: Shapes (2D), Paths (2D), Path Generators, Attachable // Topics: Shapes (2D), Paths (2D), Path Generators, Attachable
// See Also: circle(), ellipse(), egg() // See Also: circle(), ellipse(), egg()
// Description: // Description:
@ -1357,11 +1330,9 @@ function _superformula(theta,m1,m2,n1,n2=1,n3=1,a=1,b=1) =
// Function&Module: supershape() // Function&Module: supershape()
// Usage: As Module // Usage: As Module
// supershape(step, [m1=], [m2=], [n1=], [n2=], [n3=], [a=], [b=], <r=/d=>); // supershape(step, [m1=], [m2=], [n1=], [n2=], [n3=], [a=], [b=], [r=/d=]) [ATTACHMENTS];
// Usage: With Attachments
// supershape(step, [m1=], [m2=], [n1=], [n2=], [n3=], [a=], [b=], <r=/d=>) { attachments }
// Usage: As Function // Usage: As Function
// path = supershape(step, [m1=], [m2=], [n1=], [n2=], [n3=], [a=], [b=], <r=/d=>); // path = supershape(step, [m1=], [m2=], [n1=], [n2=], [n3=], [a=], [b=], [r=/d=]);
// Topics: Shapes (2D), Paths (2D), Path Generators, Attachable // Topics: Shapes (2D), Paths (2D), Path Generators, Attachable
// See Also: circle(), ellipse() // See Also: circle(), ellipse()
// Description: // Description:
@ -1438,9 +1409,9 @@ module supershape(step=0.5,m1=4,m2=undef,n1,n2=undef,n3=undef,a=1,b=undef, r=und
// Function&Module: reuleaux_polygon() // Function&Module: reuleaux_polygon()
// Usage: As Module // Usage: As Module
// reuleaux_polygon(n, r|d, ...); // reuleaux_polygon(n, r|d=, ...) [ATTACHMENTS];
// Usage: As Function // Usage: As Function
// path = reuleaux_polygon(n, r|d, ...); // path = reuleaux_polygon(n, r|d=, ...);
// Topics: Shapes (2D), Paths (2D), Path Generators, Attachable // Topics: Shapes (2D), Paths (2D), Path Generators, Attachable
// See Also: regular_ngon(), pentagon(), hexagon(), octagon() // See Also: regular_ngon(), pentagon(), hexagon(), octagon()
// Description: // Description:
@ -1510,7 +1481,7 @@ function reuleaux_polygon(n=3, r, d, anchor=CENTER, spin=0) =
// text(text, [size], [font], ...); // text(text, [size], [font], ...);
// Description: // Description:
// Creates a 3D text block that can be attached to other attachable objects. // Creates a 3D text block that can be attached to other attachable objects.
// NOTE: This cannot have children attached to it. // NOTE: You cannot attach children to this.
// Arguments: // Arguments:
// text = The text string to instantiate as an object. // text = The text string to instantiate as an object.
// size = The font size used to create the text block. Default: 10 // size = The font size used to create the text block. Default: 10
@ -1598,10 +1569,10 @@ module text(text, size=10, font="Helvetica", halign, valign, spacing=1.0, direct
// Module: round2d() // Module: round2d()
// Usage: // Usage:
// round2d(r) ... // round2d(r) [ATTACHMENTS];
// round2d(or) ... // round2d(or=) [ATTACHMENTS];
// round2d(ir) ... // round2d(ir=) [ATTACHMENTS];
// round2d(or, ir) ... // round2d(or=, ir=) [ATTACHMENTS];
// Description: // Description:
// Rounds arbitrary 2D objects. Giving `r` rounds all concave and convex corners. Giving just `ir` // Rounds arbitrary 2D objects. Giving `r` rounds all concave and convex corners. Giving just `ir`
// rounds just concave corners. Giving just `or` rounds convex corners. Giving both `ir` and `or` // rounds just concave corners. Giving just `or` rounds convex corners. Giving both `ir` and `or`
@ -1609,6 +1580,7 @@ module text(text, size=10, font="Helvetica", halign, valign, spacing=1.0, direct
// any parts narrower than twice the `or` radius. Such parts will disappear. // any parts narrower than twice the `or` radius. Such parts will disappear.
// Arguments: // Arguments:
// r = Radius to round all concave and convex corners to. // r = Radius to round all concave and convex corners to.
// ---
// or = Radius to round only outside (convex) corners to. Use instead of `r`. // or = Radius to round only outside (convex) corners to. Use instead of `r`.
// ir = Radius to round only inside (concave) corners to. Use instead of `r`. // ir = Radius to round only inside (concave) corners to. Use instead of `r`.
// Examples(2D): // Examples(2D):
@ -1626,7 +1598,7 @@ module round2d(r, or, ir)
// Module: shell2d() // Module: shell2d()
// Usage: // Usage:
// shell2d(thickness, [or], [ir], [fill], [round]) // shell2d(thickness, [or], [ir])
// Description: // Description:
// Creates a hollow shell from 2D children, with optional rounding. // Creates a hollow shell from 2D children, with optional rounding.
// Arguments: // Arguments:

View file

@ -19,7 +19,7 @@
// Function&Module: skin() // Function&Module: skin()
// Usage: As module: // Usage: As module:
// skin(profiles, slices, [z=], [refine=], [method=], [sampling=], [caps=], [closed=], [style=], [convexity=], [anchor=],[cp=],[spin=],[orient=],[atype=]) {attachments}; // skin(profiles, slices, [z=], [refine=], [method=], [sampling=], [caps=], [closed=], [style=], [convexity=], [anchor=],[cp=],[spin=],[orient=],[atype=]) [ATTACHMENTS];
// Usage: As function: // Usage: As function:
// vnf = skin(profiles, slices, [z=], [refine=], [method=], [sampling=], [caps=], [closed=], [style=], [anchor=],[cp=],[spin=],[orient=],[atype=]); // vnf = skin(profiles, slices, [z=], [refine=], [method=], [sampling=], [caps=], [closed=], [style=], [anchor=],[cp=],[spin=],[orient=],[atype=]);
// Description: // Description:
@ -504,7 +504,7 @@ function skin(profiles, slices, refine=1, method="direct", sampling, caps, close
// Function&Module: linear_sweep() // Function&Module: linear_sweep()
// Usage: // Usage:
// linear_sweep(region, [height], [center=], [slices=], [twist=], [scale=], [style=], [convexity=]) {attachments}; // linear_sweep(region, [height], [center=], [slices=], [twist=], [scale=], [style=], [convexity=]) [ATTACHMENTS];
// Description: // Description:
// If called as a module, creates a polyhedron that is the linear extrusion of the given 2D region or polygon. // If called as a module, creates a polyhedron that is the linear extrusion of the given 2D region or polygon.
// If called as a function, returns a VNF that can be used to generate a polyhedron of the linear extrusion // If called as a function, returns a VNF that can be used to generate a polyhedron of the linear extrusion
@ -623,7 +623,7 @@ function linear_sweep(region, height=1, center, twist=0, scale=1, slices,
// Function&Module: spiral_sweep() // Function&Module: spiral_sweep()
// Usage: // Usage:
// spiral_sweep(poly, h, r, turns, [higbee=], [center=], [r1=], [r2=], [d=], [d1=], [d2=], [higbee1=], [higbee2=], [internal=], [anchor=], [spin=], [orient=]){attachments}; // spiral_sweep(poly, h, r, turns, [higbee=], [center=], [r1=], [r2=], [d=], [d1=], [d2=], [higbee1=], [higbee2=], [internal=], [anchor=], [spin=], [orient=])[ATTACHMENTS];
// vnf = spiral_sweep(poly, h, r, turns, ...); // vnf = spiral_sweep(poly, h, r, turns, ...);
// Description: // Description:
// Takes a closed 2D polygon path, centered on the XY plane, and sweeps/extrudes it along a 3D spiral path // Takes a closed 2D polygon path, centered on the XY plane, and sweeps/extrudes it along a 3D spiral path
@ -731,9 +731,9 @@ module spiral_sweep(poly, h, r, turns=1, higbee, center, r1, r2, d, d1, d2, higb
// Function&Module: path_sweep() // Function&Module: path_sweep()
// Usage: As module // Usage: As module
// path_sweep(shape, path, [method], [normal=], [closed=], [twist=], [twist_by_length=], [symmetry=], [last_normal=], [tangent=], [uniform=], [relaxed=], [caps=], [style=], [convexity=], [anchor=], [cp=], [spin=], [orient=], [atype=]) {attachments}; // path_sweep(shape, path, [method], [normal=], [closed=], [twist=], [twist_by_length=], [symmetry=], [last_normal=], [tangent=], [uniform=], [relaxed=], [caps=], [style=], [convexity=], [anchor=], [cp=], [spin=], [orient=], [atype=]) [ATTACHMENTS];
// Usage: As function // Usage: As function
// vnf = path_sweep(shape, path, [method], [normal=], [closed=], [twist=], [twist_by_length=], [symmetry=], [last_normal=], [tangent=], [uniform=], [relaxed=], [caps=], [style=], [transforms=], [anchor=], [cp=], [spin=], [orient=], [atype=]) {attachments}; // vnf = path_sweep(shape, path, [method], [normal=], [closed=], [twist=], [twist_by_length=], [symmetry=], [last_normal=], [tangent=], [uniform=], [relaxed=], [caps=], [style=], [transforms=], [anchor=], [cp=], [spin=], [orient=], [atype=]);
// Description: // Description:
// Takes as input `shape`, a 2D polygon path (list of points), and `path`, a 2d or 3d path (also a list of points) // Takes as input `shape`, a 2D polygon path (list of points), and `path`, a 2d or 3d path (also a list of points)
// and constructs a polyhedron by sweeping the shape along the path. When run as a module returns the polyhedron geometry. // and constructs a polyhedron by sweeping the shape along the path. When run as a module returns the polyhedron geometry.
@ -1264,7 +1264,7 @@ function path_sweep(shape, path, method="incremental", normal, closed=false, twi
// Function&Module: path_sweep2d() // Function&Module: path_sweep2d()
// Usage: as module // Usage: as module
// path_sweep2d(shape, path, [closed], [caps], [quality], [style], [convexity=], [anchor=], [spin=], [orient=], [atype=], [cp=]) {attachments}; // path_sweep2d(shape, path, [closed], [caps], [quality], [style], [convexity=], [anchor=], [spin=], [orient=], [atype=], [cp=]) [ATTACHMENTS];
// Usage: as function // Usage: as function
// vnf = path_sweep2d(shape, path, [closed], [caps], [quality], [style], [anchor=], [spin=], [orient=], [atype=], [cp=]); // vnf = path_sweep2d(shape, path, [closed], [caps], [quality], [style], [anchor=], [spin=], [orient=], [atype=], [cp=]);
// Description: // Description:
@ -1388,7 +1388,7 @@ function _ofs_face_edge(face,firstlen,second=false) =
// Function&Module: sweep() // Function&Module: sweep()
// Usage: As Module // Usage: As Module
// sweep(shape, transforms, [closed], [caps], [style], [convexity=], [anchor=], [spin=], [orient=], [atype=]) [attachments]; // sweep(shape, transforms, [closed], [caps], [style], [convexity=], [anchor=], [spin=], [orient=], [atype=]) [ATTACHMENTS];
// Usage: As Function // Usage: As Function
// vnf = sweep(shape, transforms, [closed], [caps], [style], [anchor=], [spin=], [orient=], [atype=]); // vnf = sweep(shape, transforms, [closed], [caps], [style], [anchor=], [spin=], [orient=], [atype=]);
// Description: // Description:

View file

@ -75,7 +75,7 @@ _NO_ARG = [true,[123232345],false];
// Aliases: translate() // Aliases: translate()
// //
// Usage: As Module // Usage: As Module
// move(v) children; // move(v) CHILDREN;
// Usage: As a function to translate points, VNF, or Bezier patch // Usage: As a function to translate points, VNF, or Bezier patch
// pts = move(v, p); // pts = move(v, p);
// pts = move(STRING, p); // pts = move(STRING, p);
@ -161,7 +161,7 @@ function translate(v=[0,0,0], p=_NO_ARG) = move(v=v, p=p);
// Function&Module: left() // Function&Module: left()
// //
// Usage: As Module // Usage: As Module
// left(x) children; // left(x) CHILDREN;
// Usage: Translate Points // Usage: Translate Points
// pts = left(x, p); // pts = left(x, p);
// Usage: Get Translation Matrix // Usage: Get Translation Matrix
@ -204,7 +204,7 @@ function left(x=0, p=_NO_ARG) =
// Aliases: xmove() // Aliases: xmove()
// //
// Usage: As Module // Usage: As Module
// right(x) children; // right(x) CHILDREN;
// Usage: Translate Points // Usage: Translate Points
// pts = right(x, p); // pts = right(x, p);
// Usage: Get Translation Matrix // Usage: Get Translation Matrix
@ -257,7 +257,7 @@ function xmove(x=0, p=_NO_ARG) =
// Function&Module: fwd() // Function&Module: fwd()
// //
// Usage: As Module // Usage: As Module
// fwd(y) children; // fwd(y) CHILDREN;
// Usage: Translate Points // Usage: Translate Points
// pts = fwd(y, p); // pts = fwd(y, p);
// Usage: Get Translation Matrix // Usage: Get Translation Matrix
@ -300,7 +300,7 @@ function fwd(y=0, p=_NO_ARG) =
// Aliases: ymove() // Aliases: ymove()
// //
// Usage: As Module // Usage: As Module
// back(y) children; // back(y) CHILDREN;
// Usage: Translate Points // Usage: Translate Points
// pts = back(y, p); // pts = back(y, p);
// Usage: Get Translation Matrix // Usage: Get Translation Matrix
@ -353,7 +353,7 @@ function ymove(y=0,p=_NO_ARG) =
// Function&Module: down() // Function&Module: down()
// //
// Usage: As Module // Usage: As Module
// down(z) children; // down(z) CHILDREN;
// Usage: Translate Points // Usage: Translate Points
// pts = down(z, p); // pts = down(z, p);
// Usage: Get Translation Matrix // Usage: Get Translation Matrix
@ -394,7 +394,7 @@ function down(z=0, p=_NO_ARG) =
// Aliases: zmove() // Aliases: zmove()
// //
// Usage: As Module // Usage: As Module
// up(z) children; // up(z) CHILDREN;
// Usage: Translate Points // Usage: Translate Points
// pts = up(z, p); // pts = up(z, p);
// Usage: Get Translation Matrix // Usage: Get Translation Matrix
@ -452,10 +452,10 @@ function zmove(z=0, p=_NO_ARG) =
// Function&Module: rot() // Function&Module: rot()
// //
// Usage: As a Module // Usage: As a Module
// rot(a, [cp=], [reverse=]) children; // rot(a, [cp=], [reverse=]) CHILDREN;
// rot([X,Y,Z], [cp=], [reverse=]) children; // rot([X,Y,Z], [cp=], [reverse=]) CHILDREN;
// rot(a, v, [cp=], [reverse=]) children; // rot(a, v, [cp=], [reverse=]) CHILDREN;
// rot(from=, to=, [a=], [reverse=]) children; // rot(from=, to=, [a=], [reverse=]) CHILDREN;
// Usage: As a Function to transform data in `p` // Usage: As a Function to transform data in `p`
// pts = rot(a, p=, [cp=], [reverse=]); // pts = rot(a, p=, [cp=], [reverse=]);
// pts = rot([X,Y,Z], p=, [cp=], [reverse=]); // pts = rot([X,Y,Z], p=, [cp=], [reverse=]);
@ -556,7 +556,7 @@ function rot(a=0, v, cp, from, to, reverse=false, p=_NO_ARG, _m) =
// Function&Module: xrot() // Function&Module: xrot()
// //
// Usage: As Module // Usage: As Module
// xrot(a, [cp=]) children; // xrot(a, [cp=]) CHILDREN;
// Usage: As a function to rotate points // Usage: As a function to rotate points
// rotated = xrot(a, p, [cp=]); // rotated = xrot(a, p, [cp=]);
// Usage: As a function to return rotation matrix // Usage: As a function to return rotation matrix
@ -602,7 +602,7 @@ function xrot(a=0, p=_NO_ARG, cp) = rot([a,0,0], cp=cp, p=p);
// Function&Module: yrot() // Function&Module: yrot()
// //
// Usage: As Module // Usage: As Module
// yrot(a, [cp=]) children; // yrot(a, [cp=]) CHILDREN;
// Usage: Rotate Points // Usage: Rotate Points
// rotated = yrot(a, p, [cp=]); // rotated = yrot(a, p, [cp=]);
// Usage: Get Rotation Matrix // Usage: Get Rotation Matrix
@ -648,7 +648,7 @@ function yrot(a=0, p=_NO_ARG, cp) = rot([0,a,0], cp=cp, p=p);
// Function&Module: zrot() // Function&Module: zrot()
// //
// Usage: As Module // Usage: As Module
// zrot(a, [cp=]) children; // zrot(a, [cp=]) CHILDREN;
// Usage: As Function to rotate points // Usage: As Function to rotate points
// rotated = zrot(a, p, [cp=]); // rotated = zrot(a, p, [cp=]);
// Usage: As Function to return rotation matrix // Usage: As Function to return rotation matrix
@ -699,8 +699,8 @@ function zrot(a=0, p=_NO_ARG, cp) = rot(a, cp=cp, p=p);
// Function&Module: scale() // Function&Module: scale()
// Usage: As Module // Usage: As Module
// scale(SCALAR) children; // scale(SCALAR) CHILDREN;
// scale([X,Y,Z]) children; // scale([X,Y,Z]) CHILDREN;
// Usage: Scale Points // Usage: Scale Points
// pts = scale(v, p, [cp=]); // pts = scale(v, p, [cp=]);
// Usage: Get Scaling Matrix // Usage: Get Scaling Matrix
@ -750,7 +750,7 @@ function scale(v=1, p=_NO_ARG, cp=[0,0,0]) =
// //
// //
// Usage: As Module // Usage: As Module
// xscale(x, [cp=]) children; // xscale(x, [cp=]) CHILDREN;
// Usage: Scale Points // Usage: Scale Points
// scaled = xscale(x, p, [cp=]); // scaled = xscale(x, p, [cp=]);
// Usage: Get Affine Matrix // Usage: Get Affine Matrix
@ -804,7 +804,7 @@ function xscale(x=1, p=_NO_ARG, cp=0) =
// Function&Module: yscale() // Function&Module: yscale()
// //
// Usage: As Module // Usage: As Module
// yscale(y, [cp=]) children; // yscale(y, [cp=]) CHILDREN;
// Usage: Scale Points // Usage: Scale Points
// scaled = yscale(y, p, [cp=]); // scaled = yscale(y, p, [cp=]);
// Usage: Get Affine Matrix // Usage: Get Affine Matrix
@ -858,7 +858,7 @@ function yscale(y=1, p=_NO_ARG, cp=0) =
// Function&Module: zscale() // Function&Module: zscale()
// //
// Usage: As Module // Usage: As Module
// zscale(z, [cp=]) children; // zscale(z, [cp=]) CHILDREN;
// Usage: Scale Points // Usage: Scale Points
// scaled = zscale(z, p, [cp=]); // scaled = zscale(z, p, [cp=]);
// Usage: Get Affine Matrix // Usage: Get Affine Matrix
@ -915,7 +915,7 @@ function zscale(z=1, p=_NO_ARG, cp=0) =
// Function&Module: mirror() // Function&Module: mirror()
// Usage: As Module // Usage: As Module
// mirror(v) children; // mirror(v) CHILDREN;
// Usage: As Function // Usage: As Function
// pt = mirror(v, p); // pt = mirror(v, p);
// Usage: Get Reflection/Mirror Matrix // Usage: Get Reflection/Mirror Matrix
@ -985,7 +985,7 @@ function mirror(v, p=_NO_ARG) =
// Function&Module: xflip() // Function&Module: xflip()
// //
// Usage: As Module // Usage: As Module
// xflip([x=]) children; // xflip([x=]) CHILDREN;
// Usage: As Function // Usage: As Function
// pt = xflip(p, [x]); // pt = xflip(p, [x]);
// Usage: Get Affine Matrix // Usage: Get Affine Matrix
@ -1039,7 +1039,7 @@ function xflip(p=_NO_ARG, x=0) =
// Function&Module: yflip() // Function&Module: yflip()
// //
// Usage: As Module // Usage: As Module
// yflip([y=]) children; // yflip([y=]) CHILDREN;
// Usage: As Function // Usage: As Function
// pt = yflip(p, [y]); // pt = yflip(p, [y]);
// Usage: Get Affine Matrix // Usage: Get Affine Matrix
@ -1093,7 +1093,7 @@ function yflip(p=_NO_ARG, y=0) =
// Function&Module: zflip() // Function&Module: zflip()
// //
// Usage: As Module // Usage: As Module
// zflip([z=]) children; // zflip([z=]) CHILDREN;
// Usage: As Function // Usage: As Function
// pt = zflip(p, [z]); // pt = zflip(p, [z]);
// Usage: Get Affine Matrix // Usage: Get Affine Matrix
@ -1146,7 +1146,7 @@ function zflip(p=_NO_ARG, z=0) =
// Function&Module: frame_map() // Function&Module: frame_map()
// Usage: As module // Usage: As module
// frame_map(v1, v2, v3, [reverse=]) children; // frame_map(v1, v2, v3, [reverse=]) CHILDREN;
// Usage: As function to remap points // Usage: As function to remap points
// transformed = frame_map(v1, v2, v3, p=points, [reverse=]); // transformed = frame_map(v1, v2, v3, p=points, [reverse=]);
// Usage: As function to return a transformation matrix: // Usage: As function to return a transformation matrix:
@ -1234,7 +1234,7 @@ module frame_map(x,y,z,p,reverse=false)
// Function&Module: skew() // Function&Module: skew()
// Usage: As Module // Usage: As Module
// skew([sxy=], [sxz=], [syx=], [syz=], [szx=], [szy=]) children; // skew([sxy=], [sxz=], [syx=], [syz=], [szx=], [szy=]) CHILDREN;
// Usage: As Function // Usage: As Function
// pts = skew(p, [sxy=], [sxz=], [syx=], [syz=], [szx=], [szy=]); // pts = skew(p, [sxy=], [sxz=], [syx=], [syz=], [szx=], [szy=]);
// Usage: Get Affine Matrix // Usage: Get Affine Matrix

View file

@ -831,8 +831,8 @@ function _slice_3dpolygons(polys, dir, cuts) =
// Module: vnf_polyhedron() // Module: vnf_polyhedron()
// Usage: // Usage:
// vnf_polyhedron(vnf); // vnf_polyhedron(vnf) [ATTACHMENTS];
// vnf_polyhedron([VNF, VNF, VNF, ...]); // vnf_polyhedron([VNF, VNF, VNF, ...]) [ATTACHMENTS];
// Description: // Description:
// Given a VNF structure, or a list of VNF structures, creates a polyhedron from them. // Given a VNF structure, or a list of VNF structures, creates a polyhedron from them.
// Arguments: // Arguments: