diff --git a/affine.scad b/affine.scad index 55c3ea3..a45462c 100644 --- a/affine.scad +++ b/affine.scad @@ -42,7 +42,7 @@ function ident(n) = [ // Function: is_affine() // Usage: -// bool = is_affine(x,); +// bool = is_affine(x, [dim]); // Topics: Affine, Matrices, Transforms, Type Checking // See Also: is_matrix() // Description: @@ -649,10 +649,10 @@ function affine3d_rot_from_to(from, to) = // Function: affine3d_frame_map() // Usage: -// map = affine3d_frame_map(v1, v2, v3, ); -// map = affine3d_frame_map(x=VECTOR1, y=VECTOR2, ); -// map = affine3d_frame_map(x=VECTOR1, z=VECTOR2, ); -// map = affine3d_frame_map(y=VECTOR1, z=VECTOR2, ); +// map = affine3d_frame_map(v1, v2, v3, [reverse=]); +// map = affine3d_frame_map(x=VECTOR1, y=VECTOR2, [reverse=]); +// map = affine3d_frame_map(x=VECTOR1, z=VECTOR2, [reverse=]); +// map = affine3d_frame_map(y=VECTOR1, z=VECTOR2, [reverse=]); // Topics: Affine, Matrices, Transforms, Rotation // See Also: rot(), xrot(), yrot(), zrot(), affine2d_zrot() // Description: @@ -750,7 +750,7 @@ function affine3d_mirror(v) = // Function: affine3d_skew() // Usage: -// mat = affine3d_skew(, , , , , ); +// mat = affine3d_skew([sxy=], [sxz=], [syx=], [syz=], [szx=], [szy=]); // Topics: Affine, Matrices, Transforms, Skewing // See Also: skew(), affine3d_skew_xy(), affine3d_skew_xz(), affine3d_skew_yz(), affine2d_skew() // Description: diff --git a/arrays.scad b/arrays.scad index 69bc189..3e67724 100644 --- a/arrays.scad +++ b/arrays.scad @@ -20,7 +20,7 @@ // Function: is_homogeneous() // Alias: is_homogenous() // Usage: -// bool = is_homogeneous(list,depth); +// bool = is_homogeneous(list, depth); // Topics: List Handling, Type Checking // See Also: is_vector(), is_matrix() // Description: @@ -62,10 +62,10 @@ function _same_type(a,b, depth) = // at that position when `start` is a number or the selected list of entries when `start` is // a list of indices or a range. // Usage: -// item = select(list,start); -// item = select(list,[s:d:e]); -// item = select(list,[i0,i1...,ik]); -// list = select(list,start,end); +// item = select(list, start); +// item = select(list, RANGE); +// item = select(list, INDEXLIST); +// list = select(list, start, end); // Arguments: // list = The list to get the portion of. // start = Either the index of the first item or an index range or a list of indices. @@ -102,7 +102,7 @@ function select(list, start, end) = // Function: slice() // Usage: -// list = slice(list,s,e); +// list = slice(list, s, e); // Description: // Returns a slice of a list, from the first position `s` up to and including the last position `e`. // The first item in the list is at index 0. Negative indexes are counted back from the end. @@ -150,7 +150,7 @@ function last(list) = // Function: list_head() // Usage: -// list = list_head(list,); +// list = list_head(list, [to]); // Topics: List Handling // See Also: select(), slice(), list_tail(), last() // Description: @@ -177,7 +177,7 @@ function list_head(list, to=-2) = // Function: list_tail() // Usage: -// list = list_tail(list,); +// list = list_tail(list, [from]); // Topics: List Handling // See Also: select(), slice(), list_tail(), last() // Description: @@ -223,7 +223,7 @@ function list(l) = is_list(l)? l : [for (x=l) x]; // Function: force_list() // Usage: -// list = force_list(value, , ); +// list = force_list(value, [n], [fill]); // Topics: List Handling // See Also: scalar_vec3() // Description: @@ -248,7 +248,7 @@ function force_list(value, n=1, fill) = // Function: add_scalar() // Usage: -// v = add_scalar(v,s); +// v = add_scalar(v, s); // Topics: List Handling // Description: // Given a list and a scalar, returns the list with the scalar added to each item in it. @@ -265,7 +265,7 @@ function add_scalar(v,s) = // Function: in_list() // Usage: -// bool = in_list(val,list, ); +// bool = in_list(val, list, [idx]); // Topics: List Handling // Description: // Returns true if value `val` is in list `list`. When `val==NAN` the answer will be false for any list. @@ -290,8 +290,8 @@ function in_list(val,list,idx) = // Topics: List Handling // See Also: in_list() // Usage: -// idx = find_first_match(val, list, , ); -// indices = find_first_match(val, list, all=true, , ); +// idx = find_first_match(val, list, [start=], [eps=]); +// indices = find_first_match(val, list, all=true, [start=], [eps=]); // Description: // Finds the first item in `list` that matches `val`, returning the index. // Arguments: @@ -322,7 +322,7 @@ function __find_first_match(val, list, eps, i=0) = // Function: min_index() // Usage: // idx = min_index(vals); -// idxlist = min_index(vals,all=true); +// idxlist = min_index(vals, all=true); // Topics: List Handling // See Also: max_index(), list_increasing(), list_decreasing() // Description: @@ -421,7 +421,7 @@ function repeat(val, n, i=0) = // Function: count() // Usage: -// list = count(n,,); +// list = count(n, [s], [step], [reverse]); // Description: // Creates a list of `n` numbers, starting at `s`, incrementing by `step` each time. // Arguments: @@ -461,7 +461,7 @@ function reverse(x) = // Function: list_rotate() // Usage: -// rlist = list_rotate(list,); +// rlist = list_rotate(list, [n]); // Topics: List Handling // See Also: select(), reverse() // Description: @@ -497,7 +497,7 @@ function list_rotate(list,n=1) = // Function: deduplicate() // Usage: -// list = deduplicate(list,,); +// list = deduplicate(list, [close], [eps]); // Topics: List Handling // See Also: deduplicate_indexed() // Description: @@ -528,7 +528,7 @@ function deduplicate(list, closed=false, eps=EPSILON) = // Function: deduplicate_indexed() // Usage: -// new_idxs = deduplicate_indexed(list, indices, , ); +// new_idxs = deduplicate_indexed(list, indices, [closed], [eps]); // Topics: List Handling // See Also: deduplicate() // Description: @@ -572,7 +572,7 @@ function deduplicate_indexed(list, indices, closed=false, eps=EPSILON) = // Function: repeat_entries() // Usage: -// newlist = repeat_entries(list, N, ); +// newlist = repeat_entries(list, N, [exact]); // Topics: List Handling // See Also: repeat() // Description: @@ -613,7 +613,7 @@ function repeat_entries(list, N, exact=true) = // Function: list_set() // Usage: -// list = list_set(list, indices, values, , ); +// list = list_set(list, indices, values, [dflt], [minlen]); // Topics: List Handling // See Also: list_insert(), list_remove(), list_remove_values() // Description: @@ -727,8 +727,8 @@ function list_remove(list, indices) = // Function: list_remove_values() // Usage: -// list = list_remove_values(list,values); -// list = list_remove_values(list,values,all=true); +// list = list_remove_values(list, values); +// list = list_remove_values(list, values, all=true); // Topics: List Handling // See Also: list_set(), list_insert(), list_remove() // Description: @@ -756,7 +756,7 @@ function list_remove_values(list,values=[],all=false) = // Function: bselect() // Usage: -// array = bselect(array,index); +// array = bselect(array, index); // Topics: List Handling // See Also: list_bset() // Description: @@ -775,7 +775,7 @@ function bselect(array,index) = // Function: list_bset() // Usage: -// arr = list_bset(indexset, valuelist, ); +// arr = list_bset(indexset, valuelist, [dflt]); // Topics: List Handling // See Also: bselect() // Description: @@ -838,7 +838,7 @@ function list_longest(array) = // Function: list_pad() // Usage: -// arr = list_pad(array, minlen, ); +// arr = list_pad(array, minlen, [fill]); // Topics: List Handling // See Also: list_trim(), list_fit() // Description: @@ -920,7 +920,7 @@ function _valid_idx(idx,imin,imax) = // Function: shuffle() // Usage: -// shuffled = shuffle(list,); +// shuffled = shuffle(list, [seed]); // Topics: List Handling // See Also: sort(), sortidx(), unique(), unique_count() // Description: @@ -1066,7 +1066,7 @@ function _indexed_sort(arrind) = // Function: sort() // Usage: -// slist = sort(list, ); +// slist = sort(list, [idx]); // Topics: List Handling // See Also: shuffle(), sortidx(), unique(), unique_count(), group_sort() // Description: @@ -1107,7 +1107,7 @@ function sort(list, idx=undef) = // Function: sortidx() // Usage: -// idxlist = sortidx(list, ); +// idxlist = sortidx(list, [idx]); // Topics: List Handling // See Also: shuffle(), sort(), group_sort(), unique(), unique_count() // Description: @@ -1263,8 +1263,8 @@ function unique_count(list) = // Function: idx() // Usage: -// rng = idx(list, , , ); -// for(i=idx(list, , , )) ... +// rng = idx(list, [s=], [e=], [step=]); +// for(i=idx(list, [s=], [e=], [step=])) ... // Topics: List Handling, Iteration // See Also: enumerate(), pair(), triplet(), combinations(), permutations() // Description: @@ -1289,8 +1289,8 @@ function idx(list, s=0, e=-1, step=1) = // Function: enumerate() // Usage: -// arr = enumerate(l, ); -// for (x = enumerate(l, )) ... // x[0] is the index number, x[1] is the item. +// arr = enumerate(l, [idx]); +// for (x = enumerate(l, [idx])) ... // x[0] is the index number, x[1] is the item. // Topics: List Handling, Iteration // See Also: idx(), pair(), triplet(), combinations(), permutations() // Description: @@ -1316,8 +1316,8 @@ function enumerate(l,idx=undef) = // Function: pair() // Usage: -// p = pair(list, ); -// for (p = pair(list, )) ... // On each iteration, p contains a list of two adjacent items. +// p = pair(list, [wrap]); +// for (p = pair(list, [wrap])) ... // On each iteration, p contains a list of two adjacent items. // Topics: List Handling, Iteration // See Also: idx(), enumerate(), triplet(), combinations(), permutations() // Description: @@ -1346,8 +1346,8 @@ function pair(list, wrap=false) = // Function: triplet() // Usage: -// list = triplet(list, ); -// for (t = triplet(list, )) ... +// list = triplet(list, [wrap]); +// for (t = triplet(list, [wrap])) ... // Topics: List Handling, Iteration // See Also: idx(), enumerate(), pair(), combinations(), permutations() // Description: @@ -1375,8 +1375,8 @@ function triplet(list, wrap=false) = // Function: combinations() // Usage: -// list = combinations(l, ); -// for (p = combinations(l, )) ... +// list = combinations(l, [n]); +// for (p = combinations(l, [n])) ... // Topics: List Handling, Iteration // See Also: idx(), enumerate(), pair(), triplet(), permutations() // Description: @@ -1401,8 +1401,8 @@ function combinations(l,n=2,_s=0) = // Function: permutations() // Usage: -// list = permutations(l, ); -// for (p = permutations(l, )) ... +// list = permutations(l, [n]); +// for (p = permutations(l, [n])) ... // Topics: List Handling, Iteration // See Also: idx(), enumerate(), pair(), triplet(), combinations() // Description: @@ -1487,7 +1487,7 @@ function zip_long(a,b,c,fill) = // Function: set_union() // Usage: -// s = set_union(a, b, ); +// s = set_union(a, b, [get_indices]); // Topics: Set Handling, List Handling // See Also: set_difference(), set_intersection() // Description: @@ -1732,7 +1732,7 @@ function block_matrix(M) = // Function: diagonal_matrix() // Usage: -// mat = diagonal_matrix(diag, ); +// mat = diagonal_matrix(diag, [offdiag]); // Topics: Matrices, Array Handling // See Also: subindex(), submatrix() // Description: @@ -1749,7 +1749,7 @@ function diagonal_matrix(diag, offdiag=0) = // Function: submatrix_set() // Usage: -// mat = submatrix_set(M,A,,); +// mat = submatrix_set(M, A, [m], [n]); // Topics: Matrices, Array Handling // See Also: subindex(), submatrix() // Description: @@ -1777,7 +1777,7 @@ function submatrix_set(M,A,m=0,n=0) = // Function: array_group() // Usage: -// groups = array_group(v, , ); +// groups = array_group(v, [cnt], [dflt]); // Description: // Takes a flat array of values, and groups items in sets of `cnt` length. // The opposite of this is `flatten()`. @@ -1851,7 +1851,7 @@ function _array_dim_recurse(v) = // Function: array_dim() // Usage: -// dims = array_dim(v, ); +// dims = array_dim(v, [depth]); // Topics: Matrices, Array Handling // Description: // Returns the size of a multi-dimensional array. Returns a list of dimension lengths. The length @@ -1883,7 +1883,7 @@ function array_dim(v, depth=undef) = // Function: transpose() // Usage: -// arr = transpose(arr, ); +// arr = transpose(arr, [reverse]); // Topics: Matrices, Array Handling // See Also: submatrix(), block_matrix(), hstack(), flatten() // Description: @@ -1947,7 +1947,7 @@ function transpose(arr, reverse=false) = // Function: is_matrix_symmetric() // Usage: -// b = is_matrix_symmetric(A,) +// b = is_matrix_symmetric(A, [eps]) // Description: // Returns true if the input matrix is symmetric, meaning it equals its transpose. // Matrix should have numerical entries. diff --git a/attachments.scad b/attachments.scad index 915b641..3be687d 100644 --- a/attachments.scad +++ b/attachments.scad @@ -87,7 +87,7 @@ $tags_hidden = []; // Function: anchorpt() // Usage: -// a = anchorpt(name, pos, , ); +// a = anchorpt(name, pos, [orient], [spin]); // Topics: Attachments // See Also: attach_geom(), reorient(), attachable() // Description: @@ -104,21 +104,21 @@ function anchorpt(name, pos=[0,0,0], orient=UP, spin=0) = [name, pos, orient, sp // Function: attach_geom() // // Usage: Square/Trapezoid Geometry -// geom = attach_geom(two_d=true, size=, , , ...); +// geom = attach_geom(two_d=true, size=, [size2=], [shift=], ...); // Usage: Circle/Oval Geometry // geom = attach_geom(two_d=true, r=|d=, ...); // Usage: 2D Path/Polygon Geometry -// geom = attach_geom(two_d=true, path=, , ...); +// geom = attach_geom(two_d=true, path=, [extent=], ...); // Usage: Cubical/Prismoidal Geometry -// geom = attach_geom(size=, , , ...); +// geom = attach_geom(size=, [size2=], [shift=], ...); // Usage: Cylindrical Geometry -// geom = attach_geom(r=|d=, l=, , ...); +// geom = attach_geom(r=|d=, l=, [axis=], ...); // Usage: Conical Geometry -// geom = attach_geom(r1|d1=, r2=|d2=, l=, , ...); +// geom = attach_geom(r1|d1=, r2=|d2=, l=, [axis=], ...); // Usage: Spheroid/Ovoid Geometry // geom = attach_geom(r=|d=, ...); // Usage: VNF Geometry -// geom = attach_geom(vnf=, , ...); +// geom = attach_geom(vnf=, [extent=], ...); // // Topics: Attachments // See Also: reorient(), attachable() @@ -657,29 +657,29 @@ function attachment_is_shown(tags) = // Function: reorient() // // Usage: Square/Trapezoid Geometry -// mat = reorient(anchor, spin, , two_d=true, size=, , , ...); -// pts = reorient(anchor, spin, , two_d=true, size=, , , p=, ...); +// mat = reorient(anchor, spin, [orient], two_d=true, size=, [size2=], [shift=], ...); +// pts = reorient(anchor, spin, [orient], two_d=true, size=, [size2=], [shift=], p=, ...); // Usage: Circle/Oval Geometry -// mat = reorient(anchor, spin, , two_d=true, r=|d=, ...); -// pts = reorient(anchor, spin, , two_d=true, r=|d=, p=, ...); +// mat = reorient(anchor, spin, [orient], two_d=true, r=|d=, ...); +// pts = reorient(anchor, spin, [orient], two_d=true, r=|d=, p=, ...); // Usage: 2D Path/Polygon Geometry -// mat = reorient(anchor, spin, , two_d=true, path=, , ...); -// pts = reorient(anchor, spin, , two_d=true, path=, , p=, ...); +// mat = reorient(anchor, spin, [orient], two_d=true, path=, [extent=], ...); +// pts = reorient(anchor, spin, [orient], two_d=true, path=, [extent=], p=, ...); // Usage: Cubical/Prismoidal Geometry -// mat = reorient(anchor, spin, , size=, , , ...); -// pts = reorient(anchor, spin, , size=, , , p=, ...); +// mat = reorient(anchor, spin, [orient], size=, [size2=], [shift=], ...); +// pts = reorient(anchor, spin, [orient], size=, [size2=], [shift=], p=, ...); // Usage: Cylindrical Geometry -// mat = reorient(anchor, spin, , r=|d=, l=, , ...); -// pts = reorient(anchor, spin, , r=|d=, l=, , p=, ...); +// mat = reorient(anchor, spin, [orient], r=|d=, l=, [axis=], ...); +// pts = reorient(anchor, spin, [orient], r=|d=, l=, [axis=], p=, ...); // Usage: Conical Geometry -// mat = reorient(anchor, spin, , r1=|d1=, r2=|d2=, l=, , ...); -// pts = reorient(anchor, spin, , r1=|d1=, r2=|d2=, l=, , p=, ...); +// mat = reorient(anchor, spin, [orient], r1=|d1=, r2=|d2=, l=, [axis=], ...); +// pts = reorient(anchor, spin, [orient], r1=|d1=, r2=|d2=, l=, [axis=], p=, ...); // Usage: Spheroid/Ovoid Geometry -// mat = reorient(anchor, spin, , r|d=, ...); -// pts = reorient(anchor, spin, , r|d=, p=, ...); +// mat = reorient(anchor, spin, [orient], r|d=, ...); +// pts = reorient(anchor, spin, [orient], r|d=, p=, ...); // Usage: VNF Geometry -// mat = reorient(anchor, spin, , vnf, , ...); -// pts = reorient(anchor, spin, , vnf, , p=, ...); +// mat = reorient(anchor, spin, [orient], vnf, [extent], ...); +// pts = reorient(anchor, spin, [orient], vnf, [extent], p=, ...); // // Topics: Attachments // See Also: reorient(), attachable() @@ -772,21 +772,21 @@ function reorient( // Module: attachable() // // Usage: Square/Trapezoid Geometry -// attachable(anchor, spin, two_d=true, size=, , , ...) {...} +// attachable(anchor, spin, two_d=true, size=, [size2=], [shift=], ...) {...} // Usage: Circle/Oval Geometry // attachable(anchor, spin, two_d=true, r=|d=, ...) {...} // Usage: 2D Path/Polygon Geometry -// attachable(anchor, spin, two_d=true, path=, , ...) {...} +// attachable(anchor, spin, two_d=true, path=, [extent=], ...) {...} // Usage: Cubical/Prismoidal Geometry -// attachable(anchor, spin, , size=, , , ...) {...} +// attachable(anchor, spin, [orient], size=, [size2=], [shift=], ...) {...} // Usage: Cylindrical Geometry -// attachable(anchor, spin, , r=|d=, l=, , ...) {...} +// attachable(anchor, spin, [orient], r=|d=, l=, [axis=], ...) {...} // Usage: Conical Geometry -// attachable(anchor, spin, , r1=|d1=, r2=|d2=, l=, , ...) {...} +// attachable(anchor, spin, [orient], r1=|d1=, r2=|d2=, l=, [axis=], ...) {...} // Usage: Spheroid/Ovoid Geometry -// attachable(anchor, spin, , r=|d=, ...) {...} +// attachable(anchor, spin, [orient], r=|d=, ...) {...} // Usage: VNF Geometry -// attachable(anchor, spin, , vnf=, , ...) {...} +// attachable(anchor, spin, [orient], vnf=, [extent=], ...) {...} // // Topics: Attachments // See Also: reorient() @@ -997,7 +997,7 @@ module attachable( // Module: atext() // Topics: Attachments, Text // Usage: -// atext(text, , , ); +// atext(text, [h], [size], [font]); // Description: // Creates a 3D text block that can be attached to other attachable objects. // NOTE: This cannot have children attached to it. @@ -1117,8 +1117,8 @@ module position(from) // Module: attach() // Usage: -// attach(from, , ) {...} -// attach(from, to, , ) {...} +// attach(from, [overlap=], [norot=]) {...} +// attach(from, to, [overlap=], [norot=]) {...} // Topics: Attachments // See Also: attachable(), position(), face_profile(), edge_profile(), corner_profile() // Description: @@ -1164,7 +1164,7 @@ module attach(from, to, overlap, norot=false) // Module: face_profile() // Usage: -// face_profile(faces, r|d=, ) {...} +// face_profile(faces, r|d=, [convexity=]) {...} // Topics: Attachments // See Also: attachable(), position(), attach(), edge_profile(), corner_profile() // Description: @@ -1195,7 +1195,7 @@ module face_profile(faces=[], r, d, convexity=10) { // Module: edge_profile() // Usage: -// edge_profile(, , ) {...} +// edge_profile([edges], [except], [convexity]) {...} // Topics: Attachments // See Also: attachable(), position(), attach(), face_profile(), corner_profile() // Description: @@ -1248,7 +1248,7 @@ module edge_profile(edges=EDGES_ALL, except=[], convexity=10) { // Module: corner_profile() // Usage: -// corner_profile(, , , ) {...} +// corner_profile([corners], [except], , [convexity=]) {...} // Topics: Attachments // See Also: attachable(), position(), attach(), face_profile(), edge_profile() // Description: @@ -1314,7 +1314,7 @@ module corner_profile(corners=CORNERS_ALL, except=[], r, d, convexity=10) { // Module: edge_mask() // Usage: -// edge_mask(, ) {...} +// edge_mask([edges], [except]) {...} // Topics: Attachments // See Also: attachable(), position(), attach(), face_profile(), edge_profile(), corner_mask() // Description: @@ -1368,7 +1368,7 @@ module edge_mask(edges=EDGES_ALL, except=[]) { // Module: corner_mask() // Usage: -// corner_mask(, ) {...} +// corner_mask([corners], [except]) {...} // Topics: Attachments // See Also: attachable(), position(), attach(), face_profile(), edge_profile(), edge_mask() // Description: @@ -1502,8 +1502,8 @@ module show(tags="") // Module: diff() // Usage: -// diff(neg, ) {...} -// diff(neg, pos, ) {...} +// diff(neg, [keep]) {...} +// diff(neg, pos, [keep]) {...} // Topics: Attachments // See Also: tags(), recolor(), show(), hide(), intersect() // Description: @@ -1564,8 +1564,8 @@ module diff(neg, pos, keep) // Module: intersect() // Usage: -// intersect(a, ) {...} -// intersect(a, b, ) {...} +// intersect(a, [keep=]) {...} +// intersect(a, b, [keep=]) {...} // Topics: Attachments // See Also: tags(), recolor(), show(), hide(), diff() // Description: diff --git a/beziers.scad b/beziers.scad index 51808f8..1a1e166 100644 --- a/beziers.scad +++ b/beziers.scad @@ -25,8 +25,8 @@ // Topics: Bezier Paths // See Also: bez_tang(), bez_joint(), bez_end() // Usage: -// pts = bez_begin(pt, a, r, ); -// pts = bez_begin(pt, VECTOR, , ); +// pts = bez_begin(pt, a, r, [p=]); +// pts = bez_begin(pt, VECTOR, [r], [p=]); // Description: // This is used to create the first endpoint and control point of a cubic bezier path. // Arguments: @@ -94,8 +94,8 @@ function bez_begin(pt,a,r,p) = // Topics: Bezier Paths // See Also: bez_begin(), bez_joint(), bez_end() // Usage: -// pts = bez_tang(pt, a, r1, r2, ); -// pts = bez_tang(pt, VECTOR, , , ); +// pts = bez_tang(pt, a, r1, r2, [p=]); +// pts = bez_tang(pt, VECTOR, [r1], [r2], [p=]); // Description: // This creates a smooth joint in a cubic bezier path. It creates three points, being the // approaching control point, the fixed bezier control point, and the departing control @@ -128,8 +128,8 @@ function bez_tang(pt,a,r1,r2,p) = // Topics: Bezier Paths // See Also: bez_begin(), bez_tang(), bez_end() // Usage: -// pts = bez_joint(pt, a1, a2, r1, r2, , ); -// pts = bez_joint(pt, VEC1, VEC2, , , , ); +// pts = bez_joint(pt, a1, a2, r1, r2, [p1=], [p2=]); +// pts = bez_joint(pt, VEC1, VEC2, [r1=], [r2=], [p1=], [p2=]); // Description: // This creates a disjoint corner joint in a cubic bezier path. It creates three points, being // the aproaching control point, the fixed bezier control point, and the departing control point. @@ -167,8 +167,8 @@ function bez_joint(pt,a1,a2,r1,r2,p1,p2) = // Topics: Bezier Paths // See Also: bez_tang(), bez_joint(), bez_end() // Usage: -// pts = bez_end(pt, a, r, ); -// pts = bez_end(pt, VECTOR, , ); +// pts = bez_end(pt, a, r, [p=]); +// pts = bez_end(pt, VECTOR, [r], [p=]); // Description: // This is used to create the approaching control point, and the endpoint of a cubic bezier path. // See {{bez_begin()}} for examples. @@ -336,9 +336,9 @@ function _bezier_matrix(N) = // Function: bezier_derivative() // Usage: -// deriv = bezier_derivative(curve, u, ); -// derivs = bezier_derivative(curve, LIST, ); -// derivs = bezier_derivative(curve, RANGE, ); +// deriv = bezier_derivative(curve, u, [order]); +// derivs = bezier_derivative(curve, LIST, [order]); +// derivs = bezier_derivative(curve, RANGE, [order]); // Topics: Bezier Segments // See Also: bezier_curvature(), bezier_tangent(), bezier_points() // Description: @@ -409,7 +409,7 @@ function bezier_curvature(curve, u) = // Function: bezier_curve() // Usage: -// path = bezier_curve(curve, n, ); +// path = bezier_curve(curve, n, [endpoint]); // Topics: Bezier Segments // See Also: bezier_curvature(), bezier_tangent(), bezier_derivative(), bezier_points() // Description: @@ -442,7 +442,7 @@ function bezier_curve(curve,n,endpoint=true) = // Function: bezier_segment_closest_point() // Usage: -// u = bezier_segment_closest_point(bezier, pt, ); +// u = bezier_segment_closest_point(bezier, pt, [max_err]); // Topics: Bezier Segments // See Also: bezier_points() // Description: @@ -491,7 +491,7 @@ function bezier_segment_closest_point(curve, pt, max_err=0.01, u=0, end_u=1) = // Function: bezier_segment_length() // Usage: -// pathlen = bezier_segment_length(curve, , , ); +// pathlen = bezier_segment_length(curve, [start_u], [end_u], [max_deflect]); // Topics: Bezier Segments // See Also: bezier_points() // Description: @@ -602,9 +602,9 @@ function fillet3pts(p0, p1, p2, r, d, maxerr=0.1, w=0.5, dw=0.25) = let( // Function: bezier_path_point() // Usage: -// pt = bezier_path_point(path, seg, u, ); -// ptlist = bezier_path_point(path, seg, LIST, ); -// path = bezier_path_point(path, seg, RANGE, ); +// pt = bezier_path_point(path, seg, u, [N]); +// ptlist = bezier_path_point(path, seg, LIST, [N]); +// path = bezier_path_point(path, seg, RANGE, [N]); // Topics: Bezier Paths // See Also: bezier_points(), bezier_curve() // Description: @@ -665,7 +665,7 @@ function bezier_path_closest_point(path, pt, N=3, max_err=0.01, seg=0, min_seg=u // Function: bezier_path_length() // Usage: -// plen = bezier_path_length(path, , ); +// plen = bezier_path_length(path, [N], [max_deflect]); // Topics: Bezier Paths // See Also: bezier_points(), bezier_curve(), bezier_segment_length() // Description: @@ -691,7 +691,7 @@ function bezier_path_length(path, N=3, max_deflect=0.001) = // Function: bezier_path() // Usage: -// path = bezier_path(bezier, , , ) +// path = bezier_path(bezier, [splinesteps], [N], [endpoint]) // Topics: Bezier Paths // See Also: bezier_points(), bezier_curve() // Description: @@ -728,7 +728,7 @@ function bezier_path(bezier, splinesteps=16, N=3, endpoint=true) = // Function: path_to_bezier() // Usage: -// bezpath = path_to_bezier(path, , , , |); +// bezpath = path_to_bezier(path, [closed], [tangents], [uniform], [size=]|[relsize=]); // Topics: Bezier Paths, Rounding // See Also: path_tangents(), fillet_path() // Description: @@ -810,7 +810,7 @@ function path_to_bezier(path, closed=false, tangents, uniform=false, size, relsi // Function: fillet_path() // Usage: -// bezpath = fillet_path(pts, fillet, ); +// bezpath = fillet_path(pts, fillet, [maxerr]); // Topics: Bezier Paths, Rounding // See Also: path_to_bezier(), bezier_path() // Description: @@ -839,7 +839,7 @@ function fillet_path(pts, fillet, maxerr=0.1) = concat( // Function: bezier_close_to_axis() // Usage: -// bezpath = bezier_close_to_axis(bezier, , ); +// bezpath = bezier_close_to_axis(bezier, [axis], [N]); // Topics: Bezier Paths // See Also: bezier_offset() // Description: @@ -880,7 +880,7 @@ function bezier_close_to_axis(bezier, axis="X", N=3) = // Function: bezier_offset() // Usage: -// bezpath = bezier_offset(offset, bezier, ); +// bezpath = bezier_offset(offset, bezier, [N]); // Topics: Bezier Paths // See Also: bezier_close_to_axis() // Description: @@ -919,7 +919,7 @@ function bezier_offset(offset, bezier, N=3) = // Module: bezier_polygon() // Usage: -// bezier_polygon(bezier, , ); +// bezier_polygon(bezier, [splinesteps], [N]); // Topics: Bezier Paths // See Also: bezier_path() // Description: @@ -951,7 +951,7 @@ module bezier_polygon(bezier, splinesteps=16, N=3) { // Module: trace_bezier() // Usage: -// trace_bezier(bez, , ); +// trace_bezier(bez, [size], [N=]); // Topics: Bezier Paths, Debugging // See Also: bezier_path() // Description: @@ -1105,7 +1105,7 @@ function is_patch(x) = // Function: bezier_patch() // Usage: -// vnf = bezier_patch(patch, , , ); +// vnf = bezier_patch(patch, [splinesteps], [vnf=], [style=]); // Topics: Bezier Patches // See Also: bezier_points(), bezier_curve(), bezier_path(), bezier_patch_points(), bezier_triangle_point() // Description: @@ -1225,8 +1225,8 @@ function bezier_patch(patch, splinesteps=16, vnf=EMPTY_VNF, style="default") = // Function: bezier_patch_degenerate() // Usage: -// vnf = bezier_patch_degenerate(patch, , ); -// vnf_edges = bezier_patch_degenerate(patch, , , return_edges=true); +// vnf = bezier_patch_degenerate(patch, [splinesteps], [reverse]); +// vnf_edges = bezier_patch_degenerate(patch, [splinesteps], [reverse], return_edges=true); // Description: // Returns a VNF for a degenerate rectangular bezier patch where some of the corners of the patch are // equal. If the resulting patch has no faces then returns an empty VNF. Note that due to the degeneracy, @@ -1442,7 +1442,7 @@ function _bezier_triangle(tri, splinesteps=16, vnf=EMPTY_VNF) = // Function: bezier_patch_flat() // Usage: -// patch = bezier_patch_flat(size, , , , ); +// patch = bezier_patch_flat(size, [N=], [spin=], [orient=], [trans=]); // Topics: Bezier Patches // See Also: bezier_patch_points() // Description: @@ -1487,7 +1487,7 @@ function patch_reverse(patch) = // Function: bezier_surface() // Usage: -// vnf = bezier_surface(patches, , , ); +// vnf = bezier_surface(patches, [splinesteps], [vnf=], [style=]); // Topics: Bezier Patches // See Also: bezier_patch_points(), bezier_patch_flat() // Description: @@ -1530,7 +1530,7 @@ function bezier_surface(patches=[], splinesteps=16, vnf=EMPTY_VNF, style="defaul // Module: trace_bezier_patches() // Usage: -// trace_bezier_patches(patches, , , , , , , ); +// trace_bezier_patches(patches, [size=], [splinesteps=], [showcps=], [showdots=], [showpatch=], [convexity=], [style=]); // Topics: Bezier Patches, Debugging // See Also: bezier_patch_points(), bezier_patch_flat(), bezier_surface() // Description: diff --git a/bottlecaps.scad b/bottlecaps.scad index 8bf1529..fb83a0f 100644 --- a/bottlecaps.scad +++ b/bottlecaps.scad @@ -16,7 +16,7 @@ include // Module: pco1810_neck() // Usage: -// pco1810_neck() +// pco1810_neck([wall]) // Description: // Creates an approximation of a standard PCO-1810 threaded beverage bottle neck. // Arguments: @@ -137,7 +137,7 @@ function pco1810_neck(wall=2, anchor="support-ring", spin=0, orient=UP) = // Module: pco1810_cap() // Usage: -// pco1810_cap(, ); +// pco1810_cap([wall], [texture]); // Description: // Creates a basic cap for a PCO1810 threaded beverage bottle. // Arguments: @@ -208,7 +208,7 @@ function pco1810_cap(wall=2, texture="none", anchor=BOTTOM, spin=0, orient=UP) = // Module: pco1881_neck() // Usage: -// pco1881_neck() +// pco1881_neck([wall]) // Description: // Creates an approximation of a standard PCO-1881 threaded beverage bottle neck. // Arguments: @@ -329,7 +329,7 @@ function pco1881_neck(wall=2, anchor="support-ring", spin=0, orient=UP) = // Module: pco1881_cap() // Usage: -// pco1881_cap(wall, ); +// pco1881_cap(wall, [texture]); // Description: // Creates a basic cap for a PCO1881 threaded beverage bottle. // Arguments: @@ -391,7 +391,7 @@ function pco1881_cap(wall=2, texture="none", anchor=BOTTOM, spin=0, orient=UP) = // Module: generic_bottle_neck() // Usage: -// generic_bottle_neck(, ...) +// generic_bottle_neck([wall], ...) // Description: // Creates a bottle neck given specifications. // Arguments: @@ -516,7 +516,7 @@ function generic_bottle_neck( // Module: generic_bottle_cap() // Usage: -// generic_bottle_cap(wall, , ...); +// generic_bottle_cap(wall, [texture], ...); // Description: // Creates a basic threaded cap given specifications. // Arguments: @@ -605,7 +605,7 @@ function generic_bottle_cap( // Module: bottle_adapter_neck_to_cap() // Usage: -// bottle_adapter_neck_to_cap(wall, ); +// bottle_adapter_neck_to_cap(wall, [texture]); // Description: // Creates a threaded neck to cap adapter // Arguments: @@ -718,7 +718,7 @@ function bottle_adapter_neck_to_cap( // Module: bottle_adapter_cap_to_cap() // Usage: -// bottle_adapter_cap_to_cap(wall, ); +// bottle_adapter_cap_to_cap(wall, [texture]); // Description: // Creates a threaded cap to cap adapter. // Arguments: diff --git a/common.scad b/common.scad index 38e6c00..62c83ad 100644 --- a/common.scad +++ b/common.scad @@ -200,7 +200,7 @@ function is_func(x) = version_num()>20210000 && is_function(x); // Function: is_consistent() // Usage: -// bool = is_consistent(list, ); +// bool = is_consistent(list, [pattern]); // Topics: Type Checking // See Also: typeof(), is_type(), is_str(), is_def(), is_int(), is_range(), is_homogeneous() // Description: @@ -254,7 +254,7 @@ function same_shape(a,b) = is_def(b) && _list_pattern(a) == b*0; // Function: is_bool_list() // Usage: -// check = is_bool_list(list,) +// check = is_bool_list(list,[length]) // Topics: Type Checking // See Also: is_homogeneous(), is_consistent() // Description: @@ -285,7 +285,7 @@ function default(v,dflt=undef) = is_undef(v)? dflt : v; // Function: first_defined() // Usage: -// val = first_defined(v, ); +// val = first_defined(v, [recursive]); // Topics: Undef Handling // See Also: default(), one_defined(), num_defined(), any_defined(), all_defined() // Description: @@ -308,7 +308,7 @@ function first_defined(v,recursive=false,_i=0) = // Function: one_defined() // Usage: -// val = one_defined(vals, names, ) +// val = one_defined(vals, names, [dflt]) // Topics: Undef Handling // See Also: default(), first_defined(), num_defined(), any_defined(), all_defined() // Description: @@ -361,7 +361,7 @@ function num_defined(v) = // Function: any_defined() // Usage: -// bool = any_defined(v, ); +// bool = any_defined(v, [recursive]); // Topics: Undef Handling // See Also: default(), first_defined(), one_defined(), num_defined(), all_defined() // Description: @@ -382,7 +382,7 @@ function any_defined(v,recursive=false) = // Function: all_defined() // Usage: -// bool = all_defined(v, ); +// bool = all_defined(v, [recursive]); // Description: // Returns true if all items in the given array are not `undef`. // Arguments: @@ -405,7 +405,7 @@ function all_defined(v,recursive=false) = // Function: get_anchor() // Usage: -// anchr = get_anchor(anchor,center,,); +// anchr = get_anchor(anchor,center,[uncentered],[dflt]); // Topics: Argument Handling // See Also: get_radius() // Description: @@ -435,7 +435,7 @@ function get_anchor(anchor,center,uncentered=BOT,dflt=CENTER) = // Function: get_radius() // Usage: -// r = get_radius(, , , , , , ); +// r = get_radius([r1=], [r2=], [r=], [d1=], [d2=], [d=], [dflt=]); // Topics: Argument Handling // See Also: get_anchor() // Description: @@ -484,7 +484,7 @@ function get_radius(r1, r2, r, d1, d2, d, dflt) = // Function: scalar_vec3() // Usage: -// vec = scalar_vec3(v, ); +// vec = scalar_vec3(v, [dflt]); // Topics: Argument Handling // See Also: get_anchor(), get_radius(), force_list() // Description: @@ -583,7 +583,7 @@ function _valstr(x) = // Module: assert_approx() // Usage: -// assert_approx(got, expected, ); +// assert_approx(got, expected, [info]); // Topics: Error Checking, Debugging // See Also: no_children(), no_function(), no_module(), assert_equal() // Description: @@ -615,7 +615,7 @@ module assert_approx(got, expected, info) { // Module: assert_equal() // Usage: -// assert_equal(got, expected, ); +// assert_equal(got, expected, [info]); // Topics: Error Checking, Debugging // See Also: no_children(), no_function(), no_module(), assert_approx() // Description: @@ -646,7 +646,7 @@ module assert_equal(got, expected, info) { // Module: shape_compare() // Usage: -// shape_compare() {test_shape(); expected_shape();} +// shape_compare([eps]) {test_shape(); expected_shape();} // Topics: Error Checking, Debugging, Testing // See Also: assert_approx(), assert_equal() // Description: diff --git a/coords.scad b/coords.scad index f0b4272..7f4630d 100644 --- a/coords.scad +++ b/coords.scad @@ -10,7 +10,7 @@ // Function: point2d() // Usage: -// pt = point2d(p, ); +// pt = point2d(p, [fill]); // Topics: Coordinates, Points // See Also: path2d(), point3d(), path3d() // Description: @@ -41,7 +41,7 @@ function path2d(points) = // Function: point3d() // Usage: -// pt = point3d(p, ); +// pt = point3d(p, [fill]); // Topics: Coordinates, Points // See Also: path2d(), point2d(), path3d() // Description: @@ -54,7 +54,7 @@ function point3d(p, fill=0) = [for (i=[0:2]) (p[i]==undef)? fill : p[i]]; // Function: path3d() // Usage: -// pts = path3d(points, ); +// pts = path3d(points, [fill]); // Topics: Coordinates, Points, Paths // See Also: point2d(), path2d(), point3d() // Description: @@ -78,7 +78,7 @@ function path3d(points, fill=0) = // Function: point4d() // Usage: -// pt = point4d(p, ); +// pt = point4d(p, [fill]); // Topics: Coordinates, Points // See Also: point2d(), path2d(), point3d(), path3d(), path4d() // Description: @@ -91,7 +91,7 @@ function point4d(p, fill=0) = [for (i=[0:3]) (p[i]==undef)? fill : p[i]]; // Function: path4d() // Usage: -// pt = path4d(points, ); +// pt = path4d(points, [fill]); // Topics: Coordinates, Points, Paths // See Also: point2d(), path2d(), point3d(), path3d(), point4d() // Description: diff --git a/cubetruss.scad b/cubetruss.scad index 670a5c0..1929449 100644 --- a/cubetruss.scad +++ b/cubetruss.scad @@ -16,7 +16,7 @@ $cubetruss_clip_thickness = 1.6; // Function: cubetruss_dist() // Usage: -// cubetruss_dist(cubes, gaps, , ); +// cubetruss_dist(cubes, gaps, [size], [strut]); // Description: // Function to calculate the length of a cubetruss truss. // Arguments: @@ -34,7 +34,7 @@ function cubetruss_dist(cubes=0, gaps=0, size, strut) = // Module: cubetruss_segment() // Usage: -// cubetruss_segment(, , ); +// cubetruss_segment([size], [strut], [bracing]); // Description: // Creates a single cubetruss cube segment. // Arguments: @@ -103,7 +103,7 @@ module cubetruss_segment(size, strut, bracing, anchor=CENTER, spin=0, orient=UP) // Module: cubetruss_support() // Usage: -// cubetruss_support(, ); +// cubetruss_support([size], [strut]); // Description: // Creates a single cubetruss support. // Arguments: @@ -163,7 +163,7 @@ module cubetruss_support(size, strut, extents=1, anchor=CENTER, spin=0, orient=U // Module: cubetruss_clip() // Usage: -// cubetruss_clip(extents, , , ); +// cubetruss_clip(extents, [size], [strut], [clipthick]); // Description: // Creates a pair of clips to add onto the end of a truss. // Arguments: @@ -227,7 +227,7 @@ module cubetruss_clip(extents=1, size, strut, clipthick, anchor=CENTER, spin=0, // Module: cubetruss_foot() // Usage: -// cubetruss_foot(w, , , ); +// cubetruss_foot(w, [size], [strut], [clipthick]); // Description: // Creates a foot that can be clipped onto the bottom of a truss for support. // Arguments: @@ -303,7 +303,7 @@ module cubetruss_foot(w=1, size, strut, clipthick, anchor=CENTER, spin=0, orient // Module: cubetruss_joiner() // Usage: -// cubetruss_joiner(, , , , ); +// cubetruss_joiner([w], [vert], [size], [strut], [clipthick]); // Description: // Creates a part to join two cubetruss trusses end-to-end. // Arguments: @@ -370,7 +370,7 @@ module cubetruss_joiner(w=1, vert=true, size, strut, clipthick, anchor=CENTER, s // Module: cubetruss_uclip() // Usage: -// cubetruss_uclip(dual, , , ); +// cubetruss_uclip(dual, [size], [strut], [clipthick]); // Description: // Creates a small clip that can snap around one or two adjacent struts. // Arguments: @@ -415,7 +415,7 @@ module cubetruss_uclip(dual=true, size, strut, clipthick, anchor=CENTER, spin=0, // Module: cubetruss() // Usage: -// cubetruss(extents, , , , , ); +// cubetruss(extents, [clips], [bracing], [size], [strut], [clipthick]); // Description: // Creates a cubetruss truss, assembled out of one or more cubical segments. // Arguments: @@ -485,7 +485,7 @@ module cubetruss(extents=6, clips=[], bracing, size, strut, clipthick, anchor=CE // Module: cubetruss_corner() // Usage: -// cubetruss_corner(h, extents, , , , ); +// cubetruss_corner(h, extents, [bracing], [size], [strut], [clipthick]); // Description: // Creates a corner cubetruss with extents jutting out in one or more directions. // Arguments: diff --git a/debug.scad b/debug.scad index 920eec9..5c59907 100644 --- a/debug.scad +++ b/debug.scad @@ -10,7 +10,7 @@ // Module: trace_path() // Usage: -// trace_path(path, , , , , ); +// trace_path(path, [closed=], [showpts=], [N=], [size=], [color=]); // Description: // Renders lines between each point of a path. // Can also optionally show the individual vertex points. @@ -58,7 +58,7 @@ module trace_path(path, closed=false, showpts=false, N=1, size=1, color="yellow" // Module: debug_polygon() // Usage: -// debug_polygon(points, paths, , ); +// debug_polygon(points, paths, [convexity=], [size=]); // Description: // A drop-in replacement for `polygon()` that renders and labels the path points. // Arguments: @@ -129,7 +129,7 @@ module debug_polygon(points, paths, convexity=2, size=1) // Module: debug_vertices() // Usage: -// debug_vertices(vertices, , ); +// debug_vertices(vertices, [size], [disabled=]); // Description: // Draws all the vertices in an array, at their 3D position, numbered by their // position in the vertex array. Also draws any children of this module with @@ -177,7 +177,7 @@ module debug_vertices(vertices, size=1, disabled=false) { // Module: debug_faces() // Usage: -// debug_faces(vertices, faces, , ); +// debug_faces(vertices, faces, [size=], [disabled=]); // Description: // Draws all the vertices at their 3D position, numbered in blue by their // position in the vertex array. Each face will have their face number drawn @@ -243,7 +243,7 @@ module debug_faces(vertices, faces, size=1, disabled=false) { // Module: debug_vnf() // Usage: -// debug_vnf(vnfs, , , ); +// debug_vnf(vnfs, [convexity=], [txtsize=], [disabled=]); // Description: // A drop-in module to replace `vnf_polyhedron()` and help debug vertices and faces. // Draws all the vertices at their 3D position, numbered in blue by their @@ -270,7 +270,7 @@ module debug_vnf(vnf, convexity=6, txtsize=1, disabled=false) { // Function: standard_anchors() // Usage: -// anchs = standard_anchors(); +// anchs = standard_anchors([two_d]); // Description: // Return the vectors for all standard anchors. // Arguments: @@ -291,7 +291,7 @@ function standard_anchors(two_d=false) = [ // Module: anchor_arrow() // Usage: -// anchor_arrow(, , ); +// anchor_arrow([s], [color], [flag]); // Description: // Show an anchor orientation arrow. By default, tagged with the name "anchor-arrow". // Arguments: @@ -320,7 +320,7 @@ module anchor_arrow(s=10, color=[0.333,0.333,1], flag=true, $tags="anchor-arrow" // Module: anchor_arrow2d() // Usage: -// anchor_arrow2d(, , ); +// anchor_arrow2d([s], [color], [flag]); // Description: // Show an anchor orientation arrow. // Arguments: @@ -354,7 +354,7 @@ module expose_anchors(opacity=0.2) { // Module: show_anchors() // Usage: -// ... show_anchors(, , ); +// ... show_anchors([s], [std=], [custom=]); // Description: // Show all standard anchors for the parent object. // Arguments: @@ -436,7 +436,7 @@ module frame_ref(s=15, opacity=1) { // Module: ruler() // Usage: -// ruler(length, width, , , , , , , , , ); +// ruler(length, width, [thickness=], [depth=], [labels=], [pipscale=], [maxscale=], [colors=], [alpha=], [unit=], [inch=]); // Description: // Creates a ruler for checking dimensions of the model // Arguments: @@ -527,7 +527,7 @@ module ruler(length=100, width, thickness=1, depth=3, labels=false, pipscale=1/3 // Function: mod_indent() // Usage: -// str = mod_indent(); +// str = mod_indent([indent]); // Description: // Returns a string that is the total indentation for the module level you are at. // Arguments: @@ -540,7 +540,7 @@ function mod_indent(indent=" ") = // Function: mod_trace() // Usage: -// str = mod_trace(, , ); +// str = mod_trace([levs], [indent=], [modsep=]); // Description: // Returns a string that shows the current module and its parents, indented for each unprinted parent module. // Arguments: @@ -559,8 +559,8 @@ function mod_trace(levs=2, indent=" ", modsep="->") = // Function&Module: echo_matrix() // Usage: -// echo_matrix(M, , , ); -// dummy = echo_matrix(M, , , ), +// echo_matrix(M, [description=], [sig=], [eps=]); +// dummy = echo_matrix(M, [description=], [sig=], [eps=]), // Description: // Display a numerical matrix in a readable columnar format with `sig` significant // digits. Values smaller than eps display as zero. If you give a description diff --git a/distributors.scad b/distributors.scad index ee60d6b..db34690 100644 --- a/distributors.scad +++ b/distributors.scad @@ -43,21 +43,21 @@ module move_copies(a=[[0,0,0]]) // Function&Module: line_of() // // Usage: Spread `n` copies by a given spacing -// line_of(spacing, , ) ... +// line_of(spacing, [n], [p1=]) ... // Usage: Spread copies every given spacing along the line -// line_of(spacing, , ) ... +// line_of(spacing, [l=], [p1=]) ... // Usage: Spread `n` copies along the length of the line -// line_of(, , ) ... +// line_of([n=], [l=], [p1=]) ... // Usage: Spread `n` copies along the line from `p1` to `p2` -// line_of(, , ) ... +// line_of([n=], [p1=], [p2=]) ... // Usage: Spread copies every given spacing, centered along the line from `p1` to `p2` -// line_of(, , ) ... +// line_of([spacing], [p1=], [p2=]) ... // Usage: As a function -// pts = line_of(, , ); -// pts = line_of(, , ); -// pts = line_of(, , ); -// pts = line_of(, , ); -// pts = line_of(, , ); +// pts = line_of([spacing], [n], [p1=]); +// pts = line_of([spacing], [l=], [p1=]); +// pts = line_of([n=], [l=], [p1=]); +// pts = line_of([n=], [p1=], [p2=]); +// pts = line_of([spacing], [p1=], [p2=]); // Description: // When called as a function, returns a list of points at evenly spread positions along a line. // When called as a module, copies `children()` at one or more evenly spread positions along a line. diff --git a/edges.scad b/edges.scad index 0ddc880..088b5f7 100644 --- a/edges.scad +++ b/edges.scad @@ -295,7 +295,7 @@ function edges(v, except=[]) = // Module: show_edges() // Topics: Edges, Debugging // Usage: -// show_edges(edges, , , ); +// show_edges(edges, [size=], [text=], [txtsize=]); // Description: // Draws a semi-transparent cube with the given edges highlighted in red. // Arguments: @@ -555,7 +555,7 @@ function _corners_text(corners) = // Module: show_corners() // Topics: Corners, Debugging // Usage: -// show_corners(corners, , , ); +// show_corners(corners, [size=], [text=], [txtsize=]); // Description: // Draws a semi-transparent cube with the given corners highlighted in red. // Arguments: diff --git a/fnliterals.scad b/fnliterals.scad index ef46a2a..d4b2656 100644 --- a/fnliterals.scad +++ b/fnliterals.scad @@ -77,7 +77,7 @@ function filter(func, list) = // Function: reduce() // Topics: Function Literals, Looping // Usage: -// res = reduce(func, list, ); +// res = reduce(func, list, [init]); // res = reduce(function (a,b) a+b, list, ); -// res = accumulate(function (a,b) a+b, list, ); +// res = accumulate(func, list, [init]); +// res = accumulate(function (a,b) a+b, list, [init=]); // Description: // First the accumulator is set to the value in `init`. Then, for each item in `list`, the function // in `func` is called with the accumulator and that list item, and the result is stored in the @@ -234,7 +234,7 @@ function for_n(n,init,func) = // Function: find_first() // Topics: Function Literals, Searching // Usage: -// idx = find_first(val, list, , ); +// idx = find_first(val, list, [start=], [func=]); // Description: // Finds the first item in `list` which, when compared against `val` using the function literal // `func` gets a true result. By default, `func` just calls `approx()`. The signature of the @@ -265,7 +265,7 @@ function find_first(val, list, start=0, func=f_approx()) = // Function: binsearch() // Topics: Function Literals, Data Structures, Searching // Usage: -// idx = binsearch(key,list, ); +// idx = binsearch(key,list, [cmp]); // Description: // Searches a sorted list for an entry with the given key, using a binary search strategy. // Returns the index of the matching item found. If none found, returns undef. @@ -326,9 +326,9 @@ function simple_hash(x) = // Function: hashmap() // Topics: Function Literals, Data Structures, Hashing // Usage: Creating an Empty HashMap. -// hm = hashmap(); +// hm = hashmap([hashsize=]); // Usage: Creating a Populated HashMap. -// hm = hashmap(items=KEYVAL_LIST, ); +// hm = hashmap(items=KEYVAL_LIST, [hashsize=]); // Usage: Adding an Entry // hm2 = hm(key, val); // Usage: Adding Multiple Entries diff --git a/gears.scad b/gears.scad index 8a35a42..448f209 100644 --- a/gears.scad +++ b/gears.scad @@ -115,7 +115,7 @@ function adendum(pitch=5, mod) = // Function: dedendum() // Usage: -// ddn = dedendum(pitch|mod, ); +// ddn = dedendum(pitch|mod, [clearance]); // Topics: Gears // Description: // The depth of the gear tooth valley, below the pitch radius. @@ -167,7 +167,7 @@ function pitch_radius(pitch=5, teeth=11, mod) = // Function: outer_radius() // Usage: -// or = outer_radius(pitch|mod, teeth, , ); +// or = outer_radius(pitch|mod, teeth, [clearance], [interior]); // Topics: Gears // Description: // Calculates the outer radius for the gear. The gear fits entirely within a cylinder of this radius. @@ -193,7 +193,7 @@ function outer_radius(pitch=5, teeth=11, clearance, interior=false, mod) = // Function: root_radius() // Usage: -// rr = root_radius(pitch|mod, teeth, , ); +// rr = root_radius(pitch|mod, teeth, [clearance], [interior]); // Topics: Gears // Description: // Calculates the root radius for the gear, at the base of the dedendum. @@ -219,7 +219,7 @@ function root_radius(pitch=5, teeth=11, clearance, interior=false, mod) = // Function: base_radius() // Usage: -// br = base_radius(pitch|mod, teeth, ); +// br = base_radius(pitch|mod, teeth, [pressure_angle]); // Topics: Gears // Description: // Get the base circle for involute teeth, at the base of the teeth. @@ -243,7 +243,7 @@ function base_radius(pitch=5, teeth=11, pressure_angle=28, mod) = // Function: bevel_pitch_angle() // Usage: -// ang = bevel_pitch_angle(teeth, mate_teeth, ); +// ang = bevel_pitch_angle(teeth, mate_teeth, [drive_angle]); // Topics: Gears // See Also: bevel_gear() // Description: @@ -274,7 +274,7 @@ function bevel_pitch_angle(teeth, mate_teeth, drive_angle=90) = // Function: worm_gear_thickness() // Usage: -// thick = worm_gear_thickness(pitch|mod, teeth, worm_diam, , , ); +// thick = worm_gear_thickness(pitch|mod, teeth, worm_diam, [worm_arc], [crowning], [clearance]); // Topics: Gears // See Also: worm(), worm_gear() // Description: @@ -327,9 +327,9 @@ function _gear_q7(f,r,b,r2,t,s) = _gear_q6(b,s,t,(1-f)*max(b,r)+f*r2); // // Function&Module: gear_tooth_profile() // Usage: As Module -// gear_tooth_profile(pitch|mod, teeth, , , , , ); +// gear_tooth_profile(pitch|mod, teeth, [pressure_angle], [clearance], [backlash], [interior], [valleys]); // Usage: As Function -// path = gear_tooth_profile(pitch|mod, teeth, , , , , ); +// path = gear_tooth_profile(pitch|mod, teeth, [pressure_angle], [clearance], [backlash], [interior], [valleys]); // Topics: Gears // See Also: spur_gear2d() // Description: @@ -427,9 +427,9 @@ module gear_tooth_profile( // Function&Module: spur_gear2d() // Usage: As Module -// spur_gear2d(pitch|mod, teeth, , , , , ); +// spur_gear2d(pitch|mod, teeth, [hide], [pressure_angle], [clearance], [backlash], [interior]); // Usage: As Function -// poly = spur_gear2d(pitch|mod, teeth, , , , , ); +// poly = spur_gear2d(pitch|mod, teeth, [hide], [pressure_angle], [clearance], [backlash], [interior]); // Topics: Gears // See Also: spur_gear() // Description: @@ -526,9 +526,9 @@ module spur_gear2d( // Function&Module: rack2d() // Usage: As a Function -// path = rack2d(pitch|mod, teeth, height, , ); +// path = rack2d(pitch|mod, teeth, height, [pressure_angle], [backlash]); // Usage: As a Module -// rack2d(pitch|mod, teeth, height, , ); +// rack2d(pitch|mod, teeth, height, [pressure_angle], [backlash]); // Topics: Gears // See Also: spur_gear2d() // Description: @@ -647,11 +647,11 @@ module rack2d( // Function&Module: spur_gear() // Usage: As a Module -// spur_gear(pitch, teeth, thickness, , , , , , , , ); -// spur_gear(mod=, teeth=, thickness=, , ...); +// spur_gear(pitch, teeth, thickness, [shaft_diam=], [hide], [pressure_angle], [clearance], [backlash], [helical], [slices], [interior]); +// spur_gear(mod=, teeth=, thickness=, [shaft_diam=], ...); // Usage: As a Function -// vnf = spur_gear(pitch, teeth, thickness, , ...); -// vnf = spur_gear(mod=, teeth=, thickness=, , ...); +// vnf = spur_gear(pitch, teeth, thickness, [shaft_diam], ...); +// vnf = spur_gear(mod=, teeth=, thickness=, [shaft_diam], ...); // Topics: Gears // See Also: rack() // Description: @@ -813,9 +813,9 @@ module spur_gear( // Function&Module: bevel_gear() // Usage: As a Module -// bevel_gear(pitch|mod, teeth, face_width, pitch_angle, , , , , , , , , ); +// bevel_gear(pitch|mod, teeth, face_width, pitch_angle, [shaft_diam], [hide], [pressure_angle], [clearance], [backlash], [cutter_radius], [spiral_angle], [slices], [interior]); // Usage: As a Function -// vnf = bevel_gear(pitch|mod, teeth, face_width, pitch_angle, , , , , , , , ); +// vnf = bevel_gear(pitch|mod, teeth, face_width, pitch_angle, [hide], [pressure_angle], [clearance], [backlash], [cutter_radius], [spiral_angle], [slices], [interior]); // Topics: Gears // See Also: bevel_pitch_angle() // Description: @@ -1066,11 +1066,11 @@ module bevel_gear( // Function&Module: rack() // Usage: As a Module -// rack(pitch, teeth, thickness, height, , ); -// rack(mod=, teeth=, thickness=, height=, , =); +// rack(pitch, teeth, thickness, height, [pressure_angle=], [backlash=]); +// rack(mod=, teeth=, thickness=, height=, [pressure_angle=], [backlash]=); // Usage: As a Function -// vnf = rack(pitch, teeth, thickness, height, , ); -// vnf = rack(mod=, teeth=, thickness=, height=, , ); +// vnf = rack(pitch, teeth, thickness, height, [pressure_angle=], [backlash=]); +// vnf = rack(mod=, teeth=, thickness=, height=, [pressure_angle=], [backlash=]); // Topics: Gears // See Also: spur_gear() // Description: @@ -1213,9 +1213,9 @@ function rack( // Function&Module: worm() // Usage: As a Module -// worm(pitch|mod, d, l, , , , , ); +// worm(pitch|mod, d, l, [starts], [left_handed], [pressure_angle], [backlash], [clearance]); // Usage: As a Function -// vnf = worm(pitch|mod, d, l, , , , , ); +// vnf = worm(pitch|mod, d, l, [starts], [left_handed], [pressure_angle], [backlash], [clearance]); // Topics: Gears // See Also: worm_gear() // Description: @@ -1330,9 +1330,9 @@ module worm( // Function&Module: worm_gear() // Usage: As a Module -// worm_gear(pitch|mod, teeth, worm_diam, , , , , , , , ); +// worm_gear(pitch|mod, teeth, worm_diam, [worm_starts], [crowning], [left_handed], [pressure_angle], [backlash], [slices], [clearance], [shaft_diam]); // Usage: As a Function -// vnf = worm_gear(pitch|mod, teeth, worm_diam, , , , , , , ); +// vnf = worm_gear(pitch|mod, teeth, worm_diam, [worm_starts], [crowning], [left_handed], [pressure_angle], [backlash], [slices], [clearance]); // Topics: Gears // See Also: worm() // Description: diff --git a/geometry.scad b/geometry.scad index 049dfdb..305609e 100644 --- a/geometry.scad +++ b/geometry.scad @@ -1021,7 +1021,7 @@ function _covariance_evec_eval(points) = // Function: plane_from_points() // Usage: -// plane = plane_from_points(points, , ); +// plane = plane_from_points(points, [fast], [eps]); // Topics: Geometry, Planes, Points // Description: // Given a list of 3 or more coplanar 3D points, returns the coefficients of the normalized cartesian equation of a plane, @@ -1350,7 +1350,7 @@ function plane_intersection(plane1,plane2,plane3) = // Function: coplanar() // Usage: -// test = coplanar(points,); +// test = coplanar(points,[eps]); // Topics: Geometry, Coplanarity // Description: // Returns true if the given 3D points are non-collinear and are on a plane. @@ -1378,7 +1378,7 @@ function _pointlist_greatest_distance(points,plane) = // Function: points_on_plane() // Usage: -// test = points_on_plane(points, plane, ); +// test = points_on_plane(points, plane, [eps]); // Topics: Geometry, Planes, Points // Description: // Returns true if the given 3D points are on the given plane. @@ -1414,10 +1414,10 @@ function in_front_of_plane(plane, point) = // Function&Module: circle_2tangents() // Usage: As Function -// circ = circle_2tangents(pt1, pt2, pt3, r|d, ); +// circ = circle_2tangents(pt1, pt2, pt3, r|d, [tangents]); // Topics: Geometry, Circles, Tangents // Usage: As Module -// circle_2tangents(pt1, pt2, pt3, r|d, ,
); +// circle_2tangents(pt1, pt2, pt3, r|d, [h], [center]); // Description: // Given a pair of rays with a common origin, and a known circle radius/diameter, finds // the centerpoint for the circle of that size that touches both rays tangentally. @@ -1530,8 +1530,8 @@ module circle_2tangents(pt1, pt2, pt3, r, d, h, center=false) { // circ = circle_3points([pt1, pt2, pt3]); // Topics: Geometry, Circles // Usage: As Module -// circle_3points(pt1, pt2, pt3, ,
); -// circle_3points([pt1, pt2, pt3], ,
); +// circle_3points(pt1, pt2, pt3, [h], [center]); +// circle_3points([pt1, pt2, pt3], [h], [center]); // Description: // Returns the [CENTERPOINT, RADIUS, NORMAL] of the circle that passes through three non-collinear // points where NORMAL is the normal vector of the plane that the circle is on (UP or DOWN if the points are 2D). @@ -1724,7 +1724,7 @@ function circle_circle_tangents(c1,r1,c2,r2,d1,d2) = // Function: circle_line_intersection() // Usage: -// isect = circle_line_intersection(c,,,,); +// isect = circle_line_intersection(c,,[line],[bounded],[eps]); // Topics: Geometry, Circles, Lines, Intersection // Description: // Find intersection points between a 2d circle and a line, ray or segment specified by two points. @@ -1968,7 +1968,7 @@ function reindex_polygon(reference, poly, return_error=false) = // Function: align_polygon() // Usage: -// newpoly = align_polygon(reference, poly, angles, ); +// newpoly = align_polygon(reference, poly, angles, [cp]); // Topics: Geometry, Polygons // Description: // Tries the list or range of angles to find a rotation of the specified 2D polygon that best aligns @@ -2042,7 +2042,7 @@ function centroid(poly, eps=EPSILON) = // Function: point_in_polygon() // Usage: -// test = point_in_polygon(point, poly, ) +// test = point_in_polygon(point, poly, [eps]) // Topics: Geometry, Polygons // Description: // This function tests whether the given 2D point is inside, outside or on the boundary of @@ -2371,7 +2371,7 @@ function is_convex_polygon(poly,eps=EPSILON) = // Function: convex_distance() // Usage: -// dist = convex_distance(pts1, pts2,); +// dist = convex_distance(pts1, pts2,[eps=]); // Topics: Geometry, Convexity, Distance // See also: // convex_collision(), hull() @@ -2430,7 +2430,7 @@ function _GJK_distance(points1, points2, eps=EPSILON, lbd, d, simplex=[]) = // Function: convex_collision() // Usage: -// test = convex_collision(pts1, pts2,); +// test = convex_collision(pts1, pts2, [eps=]); // Topics: Geometry, Convexity, Collision, Intersection // See also: // convex_distance(), hull() diff --git a/math.scad b/math.scad index 9547702..764cdc5 100644 --- a/math.scad +++ b/math.scad @@ -62,7 +62,7 @@ function log2(x) = // Function: hypot() // Usage: -// l = hypot(x,y,); +// l = hypot(x,y,[z]); // Description: // Calculate hypotenuse length of a 2D or 3D triangle. // Arguments: @@ -79,7 +79,7 @@ function hypot(x,y,z=0) = // Function: factorial() // Usage: -// x = factorial(n,); +// x = factorial(n,[d]); // Description: // Returns the factorial of the given integer value, or n!/d! if d is given. // Arguments: @@ -177,7 +177,7 @@ function lerp(a,b,u) = // Function: lerpn() // Usage: // x = lerpn(a, b, n); -// x = lerpn(a, b, n, ); +// x = lerpn(a, b, n, [endpoint]); // Description: // Returns exactly `n` values, linearly interpolated between `a` and `b`. // If `endpoint` is true, then the last value will exactly equal `b`. @@ -463,7 +463,7 @@ function modang(x) = // Function: rand_int() // Usage: -// rand_int(minval,maxval,N,); +// rand_int(minval,maxval,N,[seed]); // Description: // Return a list of random integers in the range of minval to maxval, inclusive. // Arguments: @@ -483,7 +483,7 @@ function rand_int(minval, maxval, N, seed=undef) = // Function: gaussian_rands() // Usage: -// gaussian_rands(mean, stddev, , ) +// gaussian_rands(mean, stddev, [N], [seed]) // Description: // Returns a random number with a gaussian/normal distribution. // Arguments: @@ -499,7 +499,7 @@ function gaussian_rands(mean, stddev, N=1, seed=undef) = // Function: log_rands() // Usage: -// log_rands(minval, maxval, factor, , ); +// log_rands(minval, maxval, factor, [N], [seed]); // Description: // Returns a single random number, with a logarithmic distribution. // Arguments: @@ -568,7 +568,7 @@ function lcm(a,b=[]) = // Function: sum() // Usage: -// x = sum(v, ); +// x = sum(v, [dflt]); // Description: // Returns the sum of all entries in the given consistent list. // If passed an array of vectors, returns the sum the vectors. @@ -920,7 +920,7 @@ function _swap_matrix(n,i,j) = // Function: back_substitute() // Usage: -// x = back_substitute(R, b, ); +// x = back_substitute(R, b, [transpose]); // Description: // Solves the problem Rx=b where R is an upper triangular square matrix. The lower triangular entries of R are // ignored. If transpose==true then instead solve transpose(R)*x=b. @@ -1012,7 +1012,7 @@ function determinant(M) = // Function: is_matrix() // Usage: -// is_matrix(A,,,) +// is_matrix(A,[m],[n],[square]) // Description: // Returns true if A is a numeric matrix of height m and width n. If m or n // are omitted or set to undef then true is returned for any positive dimension. @@ -1055,7 +1055,7 @@ function matrix_trace(M) = // Function: all_zero() // Usage: -// x = all_zero(x, ); +// x = all_zero(x, [eps]); // Description: // Returns true if the finite number passed to it is approximately zero, to within `eps`. // If passed a list, recursively checks if all items in the list are approximately zero. @@ -1076,7 +1076,7 @@ function all_zero(x, eps=EPSILON) = // Function: all_nonzero() // Usage: -// x = all_nonzero(x, ); +// x = all_nonzero(x, [eps]); // Description: // Returns true if the finite number passed to it is not almost zero, to within `eps`. // If passed a list, recursively checks if all items in the list are not almost zero. @@ -1194,7 +1194,7 @@ function all_nonnegative(x) = // Function all_equal() // Usage: -// b = all_equal(vec,); +// b = all_equal(vec,[eps]); // Description: // Returns true if all of the entries in vec are equal to each other, or approximately equal to each other if eps is set. // Arguments: @@ -1206,7 +1206,7 @@ function all_equal(vec,eps=0) = // Function: approx() // Usage: -// b = approx(a,b,) +// b = approx(a,b,[eps]) // Description: // Compares two numbers or vectors, and returns true if they are closer than `eps` to each other. // Arguments: @@ -1345,8 +1345,8 @@ function _all_bool(l, i=0, out=true) = // Function: count_true() // Usage: -// n = count_true(l,); -// n = count_true(l,func,); // Requires OpenSCAD 2021.01 or later. +// n = count_true(l,[nmax=]); +// n = count_true(l,func,[nmax=]); // Requires OpenSCAD 2021.01 or later. // Requirements: // Requires OpenSCAD 2021.01 or later to use the `func=` argument. // Description: @@ -1460,7 +1460,7 @@ function _deriv_nonuniform(data, h, closed) = // Function: deriv2() // Usage: -// x = deriv2(data, , ) +// x = deriv2(data, [h], [closed]) // Description: // Computes a numerical estimate of the second derivative of the data, which may be scalar or vector valued. // The `h` parameter gives the step size of your sampling so the derivative can be scaled correctly. @@ -1504,7 +1504,7 @@ function deriv2(data, h=1, closed=false) = // Function: deriv3() // Usage: -// x = deriv3(data, , ) +// x = deriv3(data, [h], [closed]) // Description: // Computes a numerical third derivative estimate of the data, which may be scalar or vector valued. // The `h` parameter gives the step size of your sampling so the derivative can be scaled correctly. @@ -1657,7 +1657,7 @@ function c_norm(z) = norm_fro(z); // Function: quadratic_roots() // Usage: -// roots = quadratic_roots(a,b,c,) +// roots = quadratic_roots(a,b,c,[real]) // Description: // Computes roots of the quadratic equation a*x^2+b*x+c==0, where the // coefficients are real numbers. If real is true then returns only the @@ -1779,7 +1779,7 @@ function poly_add(p,q) = // Function: poly_roots() // Usage: -// poly_roots(p,) +// poly_roots(p,[tol]) // Description: // Returns all complex roots of the specified real polynomial p. // The polynomial is specified as p=[a_n, a_{n-1},...,a_1,a_0] @@ -1849,7 +1849,7 @@ function _poly_roots(p, pderiv, s, z, tol, i=0) = // Function: real_roots() // Usage: -// real_roots(p, , ) +// real_roots(p, [eps], [tol]) // Description: // Returns the real roots of the specified real polynomial p. // The polynomial is specified as p=[a_n, a_{n-1},...,a_1,a_0] diff --git a/modular_hose.scad b/modular_hose.scad index 0a878a1..3d0cade 100644 --- a/modular_hose.scad +++ b/modular_hose.scad @@ -118,7 +118,7 @@ _hose_waist = [1.7698, 1.8251, 3.95998]; // Module: modular_hose() // Usage: -// modular_hose(size, type, , , , , ) +// modular_hose(size, type, [clearance], [waist_len], [anchor], [spin], [orient]) [attachments] // Description: // Construct moduler hose segments or modular hose ends for connection to standard // modular hose systems. The 1/4", 1/2" and 3/4" sizes are supported and you can @@ -185,7 +185,7 @@ module modular_hose(size, type, clearance=0, waist_len, anchor=BOTTOM, spin=0,or // Function: modular_hose_radius() // Usage: -// r = modular_hose_radius(size, ); +// r = modular_hose_radius(size, [outer]); // Description: // Returns the inner (or outer) diameter of the waist section // of the modular hose to enable hollowing out connecting channels. diff --git a/mutators.scad b/mutators.scad index 14e4b7a..d7de360 100644 --- a/mutators.scad +++ b/mutators.scad @@ -96,9 +96,9 @@ module bounding_box(excess=0, planar=false) { // Function&Module: half_of() // // Usage: as module -// half_of(v, , , ) ... +// half_of(v, [cp], [s], [planar]) ... // Usage: as function -// result = half_of(p,v,); +// result = half_of(p,v,[cp]); // // Description: // Slices an object at a cut plane, and masks away everything that is on one side. The v parameter is either a plane specification or @@ -200,10 +200,10 @@ function half_of(p, v=UP, cp) = // Function&Module: left_half() // // Usage: as module -// left_half(, ) ... -// left_half(planar=true, , ) ... +// left_half([s], [x]) ... +// left_half(planar=true, [s], [x]) ... // Usage: as function -// result = left_half(p, ); +// result = left_half(p, [x]); // // Description: // Slices an object at a vertical Y-Z cut plane, and masks away everything that is right of it. @@ -243,7 +243,7 @@ function left_half(p,x=0) = half_of(p, LEFT, [x,0,0]); // right_half([s], [x]) ... // right_half(planar=true, [s], [x]) ... // Usage: as function -// result = right_half(p, ); +// result = right_half(p, [x]); // // Description: // Slices an object at a vertical Y-Z cut plane, and masks away everything that is left of it. @@ -280,10 +280,10 @@ function right_half(p,x=0) = half_of(p, RIGHT, [x,0,0]); // Function&Module: front_half() // // Usage: -// front_half(, ) ... -// front_half(planar=true, , ) ... +// front_half([s], [y]) ... +// front_half(planar=true, [s], [y]) ... // Usage: as function -// result = front_half(p, ); +// result = front_half(p, [y]); // // Description: // Slices an object at a vertical X-Z cut plane, and masks away everything that is behind it. @@ -320,10 +320,10 @@ function front_half(p,y=0) = half_of(p, FRONT, [0,y,0]); // Function&Module: back_half() // // Usage: -// back_half(, ) ... -// back_half(planar=true, , ) ... +// back_half([s], [y]) ... +// back_half(planar=true, [s], [y]) ... // Usage: as function -// result = back_half(p, ); +// result = back_half(p, [y]); // // Description: // Slices an object at a vertical X-Z cut plane, and masks away everything that is in front of it. @@ -360,9 +360,9 @@ function back_half(p,y=0) = half_of(p, BACK, [0,y,0]); // Function&Module: bottom_half() // // Usage: -// bottom_half(, ) ... +// bottom_half([s], [z]) ... // Usage: as function -// result = bottom_half(p, ); +// result = bottom_half(p, [z]); // // Description: // Slices an object at a horizontal X-Y cut plane, and masks away everything that is above it. @@ -392,8 +392,8 @@ function bottom_half(p,z=0) = half_of(p,BOTTOM,[0,0,z]); // Function&Module: top_half() // // Usage: -// top_half(, ) ... -// result = top_half(p, ); +// top_half([s], [z]) ... +// result = top_half(p, [z]); // // Description: // Slices an object at a horizontal X-Y cut plane, and masks away everything that is below it. @@ -475,7 +475,7 @@ module chain_hull() // Module: path_extrude2d() // Usage: -// path_extrude2d(path, ) {...} +// path_extrude2d(path, [caps]) {...} // Description: // Extrudes 2D children along the given 2D path, with optional rounded endcaps. // Arguments: diff --git a/paths.scad b/paths.scad index 8c056ec..9363d41 100644 --- a/paths.scad +++ b/paths.scad @@ -319,7 +319,7 @@ function path_closest_point(path, pt) = // Function: path_tangents() // Usage: -// tangs = path_tangents(path, , ); +// tangs = path_tangents(path, [closed], [uniform]); // Description: // Compute the tangent vector to the input path. The derivative approximation is described in deriv(). // The returns vectors will be normalized to length 1. If any derivatives are zero then @@ -352,7 +352,7 @@ function path_tangents(path, closed=false, uniform=true) = // Function: path_normals() // Usage: -// norms = path_normals(path, , ); +// norms = path_normals(path, [tangents], [closed]); // Description: // Compute the normal vector to the input path. This vector is perpendicular to the // path tangent and lies in the plane of the curve. For 3d paths we define the plane of the curve @@ -386,7 +386,7 @@ function path_normals(path, tangents, closed=false) = // Function: path_curvature() // Usage: -// curvs = path_curvature(path, ); +// curvs = path_curvature(path, [closed]); // Description: // Numerically estimate the curvature of the path (in any dimension). function path_curvature(path, closed=false) = @@ -404,7 +404,7 @@ function path_curvature(path, closed=false) = // Function: path_torsion() // Usage: -// tortions = path_torsion(path, ); +// tortions = path_torsion(path, [closed]); // Description: // Numerically estimate the torsion of a 3d path. function path_torsion(path, closed=false) = @@ -575,7 +575,7 @@ function _corner_roundover_path(p1, p2, p3, r, d) = // Topics: Paths // See Also: jittered_poly(), subdivide_long_segments() // Usage: -// jpath = path_add_jitter(path, , ); +// jpath = path_add_jitter(path, [dist], [closed=]); // Description: // Adds tiny jitter offsets to collinear points in the given path so that they // are no longer collinear. This is useful for preserving subdivision on long @@ -971,7 +971,7 @@ module modulated_circle(r, sines=[[1,1]], d) // Topics: Extrusions // See Also: path_add_jitter(), subdivide_long_segments() // Usage: -// jittered_poly(path, ); +// jittered_poly(path, [dist]); // Description: // Creates a 2D polygon shape from the given path in such a way that any extra // collinear points are not stripped out in the way that `polygon()` normally does. @@ -1010,7 +1010,10 @@ module jittered_poly(path, dist=1/512) { // xcopies(3) circle(3, $fn=32); // } module extrude_from_to(pt1, pt2, convexity, twist, scale, slices) { - assert( is_path([pt1,pt2],3), "The points should be 3d points"); + assert(is_vector(pt1)); + assert(is_vector(pt2)); + pt1 = point3d(pt1); + pt2 = point3d(pt2); rtp = xyz_to_spherical(pt2-pt1); translate(pt1) { rotate([0, rtp[2], rtp[1]]) { @@ -1285,7 +1288,7 @@ module path_spread(path, n, spacing, sp=undef, rotate_children=true, closed=fals // Function: path_cut_points() // // Usage: -// cuts = path_cut_points(path, dists, , ); +// cuts = path_cut_points(path, dists, [closed=], [direction=]); // // Description: // Cuts a path at a list of distances from the first point in the path. Returns a list of the cut @@ -1402,7 +1405,7 @@ function _path_cuts_dir(path, cuts, closed=false, eps=1e-2) = // Topics: Paths // See Also: path_cut_points() // Usage: -// path_list = path_cut(path, cutdist, ); +// path_list = path_cut(path, cutdist, [closed=]); // Description: // Given a list of distances in `cutdist`, cut the path into // subpaths at those lengths, returning a list of paths. @@ -1561,7 +1564,7 @@ function subdivide_path(path, N, refine, closed=true, exact=true, method="length // Function: path_length_fractions() // Usage: -// fracs = path_length_fractions(path, ); +// fracs = path_length_fractions(path, [closed]); // Description: // Returns the distance fraction of each point in the path along the path, so the first // point is zero and the final point is 1. If the path is closed the length of the output @@ -1583,7 +1586,7 @@ function path_length_fractions(path, closed=false) = // Function: resample_path() // Usage: -// newpath = resample_path(path, N|spacing, ); +// newpath = resample_path(path, N|spacing, [closed]); // Description: // Compute a uniform resampling of the input path. If you specify `N` then the output path will have N // points spaced uniformly (by linear interpolation along the input path segments). The only points of the diff --git a/primitives.scad b/primitives.scad index c6dc1f5..87e04b0 100644 --- a/primitives.scad +++ b/primitives.scad @@ -13,9 +13,9 @@ // Function&Module: square() // Topics: Shapes (2D), Path Generators (2D) // Usage: As a Built-in Module -// square(size,
); +// square(size, [center]); // Usage: As a Function -// path = square(size,
); +// path = square(size, [center]); // See Also: rect() // Description: // When called as the builtin module, creates a 2D square or rectangle of the given size. @@ -84,11 +84,11 @@ function circle(r, d, anchor=CENTER, spin=0) = // Function&Module: cube() // Topics: Shapes (3D), Attachable, VNF Generators // Usage: As Module -// cube(size,
, ...); +// cube(size, [center], ...); // Usage: With Attachments -// cube(size,
, ...) { attachments } +// cube(size, [center], ...) { attachments } // Usage: As Function -// vnf = cube(size,
, ...); +// vnf = cube(size, [center], ...); // See Also: cuboid(), prismoid() // Description: // Creates a 3D cubic object with support for anchoring and attachments. @@ -155,13 +155,13 @@ function cube(size=1, center, anchor, spin=0, orient=UP) = // Function&Module: cylinder() // Topics: Shapes (3D), Attachable, VNF Generators // Usage: As Module -// cylinder(h, r=/d=, , ...); -// cylinder(h, r1/d1=, r2/d2=, , ...); +// cylinder(h, r=/d=, [center=], ...); +// cylinder(h, r1/d1=, r2/d2=, [center=], ...); // Usage: With Attachments -// cylinder(h, r=/d=, ) {attachments} +// cylinder(h, r=/d=, [center=]) {attachments} // Usage: As Function -// vnf = cylinder(h, r=/d=, , ...); -// vnf = cylinder(h, r1/d1=, r2/d2=, , ...); +// vnf = cylinder(h, r=/d=, [center=], ...); +// vnf = cylinder(h, r1/d1=, r2/d2=, [center=], ...); // See Also: cyl() // Description: // Creates a 3D cylinder or conic object with support for anchoring and attachments. @@ -252,11 +252,11 @@ function cylinder(h, r1, r2, center, l, r, d, d1, d2, anchor, spin=0, orient=UP) // Function&Module: sphere() // Topics: Shapes (3D), Attachable, VNF Generators // Usage: As Module -// sphere(r|d=, , , ...); +// sphere(r|d=, [circum=], [style=], ...); // Usage: With Attachments // sphere(r|d=, ...) { attachments } // Usage: As Function -// vnf = sphere(r|d=, , , ...); +// vnf = sphere(r|d=, [circum=], [style=], ...); // See Also: spheroid() // Description: // Creates a sphere object, with support for anchoring and attachments. diff --git a/regions.scad b/regions.scad index b42b29e..7e94ac4 100644 --- a/regions.scad +++ b/regions.scad @@ -123,7 +123,7 @@ function point_in_region(point, region, eps=EPSILON, _i=0, _cnt=0) = // Function: polygons_equal() // Usage: -// b = polygons_equal(poly1, poly2, ) +// b = polygons_equal(poly1, poly2, [eps]) // Description: // Returns true if the components of region1 and region2 are the same polygons // within given epsilon tolerance. @@ -172,7 +172,7 @@ function __poly_in_polygons(poly, polys, i) = // Function: regions_equal() // Usage: -// b = regions_equal(region1, region2, ) +// b = regions_equal(region1, region2, [eps]) // Description: // Returns true if the components of region1 and region2 are the same polygons // within given epsilon tolerance. diff --git a/rounding.scad b/rounding.scad index eaf8e66..a5fabe9 100644 --- a/rounding.scad +++ b/rounding.scad @@ -15,7 +15,7 @@ include // Function: round_corners() // // Usage: -// rounded_path = round_corners(path, , , , , , ); +// rounded_path = round_corners(path, [method], [radius=], [cut=], [joint=], [closed=], [verbose=]); // // Description: // Takes a 2D or 3D path as input and rounds each corner @@ -434,7 +434,7 @@ function _rounding_offsets(edgespec,z_dir=1) = // Function: smooth_path() // Usage: -// smoothed = smooth_path(path, , , , , ); +// smoothed = smooth_path(path, [tangents], , [splinesteps=], [closed=], [uniform=]); // Description: // Smooths the input path using a cubic spline. Every segment of the path will be replaced by a cubic curve // with `splinesteps` points. The cubic interpolation will pass through every input point on the path @@ -517,7 +517,7 @@ function _scalar_to_vector(value,length,varname) = // Function: path_join() // Usage: -// joined_path = path_join(paths, , , , ); +// joined_path = path_join(paths, [joint], [k=], [relocate=], [closed=]); // Description: // Connect a sequence of paths together into a single path with optional rounding // applied at the joints. By default the first path is taken as specified and subsequent paths are @@ -679,9 +679,9 @@ function _path_join(paths,joint,k=0.5,i=0,result=[],relocate=true,closed=false) // Function&Module: offset_sweep() // Usage: most common module arguments. See Arguments list below for more. -// offset_sweep(path, , , , , ,...) +// offset_sweep(path, , [bottom], [top], [offset=], [convexity=],...) [attachments] // Usage: most common function arguments. See Arguments list below for more. -// vnf = offset_sweep(path, , , , , ...) +// vnf = offset_sweep(path, , [bottom], [top], [offset=], ...) // Description: // Takes a 2d path as input and extrudes it upwards and/or downward. Each layer in the extrusion is produced using `offset()` to expand or shrink the previous layer. When invoked as a function returns a VNF; when invoked as a module produces geometry. // Using the `top` and/or `bottom` arguments you can specify a sequence of offsets values, or you can use several built-in offset profiles that @@ -1308,10 +1308,10 @@ function _remove_undefined_vals(list) = // Function&Module: offset_stroke() // Usage: as module -// offset_stroke(path, , , , , , , , , ); +// offset_stroke(path, [width], [rounded=], [chamfer=], [start=], [end=], [check_valid=], [quality=], [maxstep=], [closed=]); // Usage: as function -// path = offset_stroke(path, , closed=false, , , , , , , ); -// region = offset_stroke(path, , closed=true, , , , , , , ); +// path = offset_stroke(path, [width], closed=false, [rounded=], [chamfer=], [start=], [end=], [check_valid=], [quality=], [maxstep=]); +// region = offset_stroke(path, [width], closed=true, [rounded=], [chamfer=], [start=], [end=], [check_valid=], [quality=], [maxstep=]); // Description: // Uses `offset()` to compute a stroke for the input path. Unlike `stroke`, the result does not need to be // centered on the input path. The corners can be rounded, pointed, or chamfered, and you can make the ends @@ -1692,9 +1692,9 @@ function _rp_compute_patches(top, bot, rtop, rsides, ktop, ksides, concave) = // Function&Module: rounded_prism() // Usage: as a module -// rounded_prism(bottom, , , , , , , , , , , , ,...) ; +// rounded_prism(bottom, [top], , [joint_top=], [joint_bot=], [joint_sides=], [k=], [k_top=], [k_bot=], [k_sides=], [splinesteps=], [debug=], [convexity=],...) [attachments]; // Usage: as a function -// vnf = rounded_prism(bottom, , , , , , , , , , , ); +// vnf = rounded_prism(bottom, [top], , [joint_top=], [joint_bot=], [joint_sides=], [k=], [k_top=], [k_bot=], [k_sides=], [splinesteps=], [debug=]); // Description: // Construct a generalized prism with continuous curvature rounding. You supply the polygons for the top and bottom of the prism. The only // limitation is that joining the edges must produce a valid polyhedron with coplanar side faces. You specify the rounding by giving diff --git a/shapes.scad b/shapes.scad index 235680b..6e870a2 100644 --- a/shapes.scad +++ b/shapes.scad @@ -11,15 +11,15 @@ // Module: cuboid() // // Usage: Standard Cubes -// cuboid(size, , , ); +// cuboid(size, [anchor=], [spin=], [orient=]); // cuboid(size, p1=, ...); // cuboid(p1=, p2=, ...); // Usage: Chamfered Cubes -// cuboid(size, , , , , ...); +// cuboid(size, [chamfer=], [edges=], [except_edges=], [trimcorners=], ...); // Usage: Rounded Cubes -// cuboid(size, , , , , ...); +// cuboid(size, [rounding=], [edges=], [except_edges=], [trimcorners=], ...); // Usage: Attaching children -// cuboid(size, , ...) ; +// cuboid(size, [anchor=], ...) [attachments]; // // Description: // Creates a cube or cuboid object, with optional chamfering or rounding. @@ -371,18 +371,18 @@ function cuboid( // Function&Module: prismoid() // // Usage: Typical Prismoids -// prismoid(size1, size2, h|l, , ...); +// prismoid(size1, size2, h|l, [shift], ...); // Usage: Attaching Children -// prismoid(size1, size2, h|l, , ...) ; +// prismoid(size1, size2, h|l, [shift], ...) [attachments]; // Usage: Chamfered Prismoids -// prismoid(size1, size2, h|l, , ...); -// prismoid(size1, size2, h|l, , , ...); +// prismoid(size1, size2, h|l, [chamfer=], ...); +// prismoid(size1, size2, h|l, [chamfer1=], [chamfer2=], ...); // Usage: Rounded Prismoids -// prismoid(size1, size2, h|l, , ...); -// prismoid(size1, size2, h|l, , , ...); +// prismoid(size1, size2, h|l, [rounding=], ...); +// prismoid(size1, size2, h|l, [rounding1=], [rounding2=], ...); // Usage: As Function -// vnf = prismoid(size1, size2, h|l, , , ); -// vnf = prismoid(size1, size2, h|l, , , , , ); +// vnf = prismoid(size1, size2, h|l, [shift], [rounding], [chamfer]); +// vnf = prismoid(size1, size2, h|l, [shift], [rounding1], [rounding2], [chamfer1], [chamfer2]); // // Description: // Creates a rectangular prismoid shape with optional roundovers and chamfering. @@ -572,9 +572,9 @@ function prismoid( // Module: rect_tube() // Usage: Typical Rectangular Tubes -// rect_tube(h, size, isize,
, ); -// rect_tube(h, size, wall=, ); -// rect_tube(h, isize=, wall=, ); +// rect_tube(h, size, isize, [center], [shift]); +// rect_tube(h, size, wall=, [center=]); +// rect_tube(h, isize=, wall=, [center=]); // Usage: Tapering Rectangular Tubes // rect_tube(h, size1=, size2=, wall=, ...); // rect_tube(h, isize1=, isize2=, wall=, ...); @@ -592,7 +592,7 @@ function prismoid( // rect_tube(h, size, isize, irounding1=, irounding2= ...); // rect_tube(h, size, isize, rounding=, irounding=, ...); // Usage: Attaching Children -// rect_tube(h, size, isize, ...) ; +// rect_tube(h, size, isize, ...) [attachments]; // // Description: // Creates a rectangular or prismoid tube with optional roundovers and/or chamfers. @@ -766,7 +766,7 @@ function rect_tube( // Module: right_triangle() // // Usage: -// right_triangle(size,
); +// right_triangle(size, [center]); // // Description: // Creates a 3D right triangular prism with the hypotenuse in the X+Y+ quadrant. @@ -816,16 +816,16 @@ function right_triangle(size=[1,1,1], center, anchor, spin=0, orient=UP) = // the cylinder's length. // // Usage: Normal Cylinders -// cyl(l|h, r,
, , ); +// cyl(l|h, r, [center], [circum=], [realign=]); // cyl(l|h, d=, ...); // cyl(l|h, r1=, r2=, ...); // cyl(l|h, d1=, d2=, ...); // // Usage: Chamferred Cylinders -// cyl(l|h, r|d, chamfer=, , , ...); -// cyl(l|h, r|d, chamfer1=, , , ...); -// cyl(l|h, r|d, chamfer2=, , , ...); -// cyl(l|h, r|d, chamfer1=, chamfer2=, , , , ...); +// cyl(l|h, r|d, chamfer=, [chamfang=], [from_end=], ...); +// cyl(l|h, r|d, chamfer1=, [chamfang1=], [from_end=], ...); +// cyl(l|h, r|d, chamfer2=, [chamfang2=], [from_end=], ...); +// cyl(l|h, r|d, chamfer1=, chamfer2=, [chamfang1=], [chamfang2=], [from_end=], ...); // // Usage: Rounded End Cylinders // cyl(l|h, r|d, rounding=, ...); @@ -1016,11 +1016,11 @@ module cyl( // Creates a cylinder oriented along the X axis. // // Usage: Typical -// xcyl(l|h, r, ); -// xcyl(l|h, d=, ); -// xcyl(l|h, r1=|d1=, r2=|d2=, ); +// xcyl(l|h, r, [anchor=]); +// xcyl(l|h, d=, [anchor=]); +// xcyl(l|h, r1=|d1=, r2=|d2=, [anchor=]); // Usage: Attaching Children -// xcyl(l|h, r, ) ; +// xcyl(l|h, r, [anchor=]) [attachments]; // // Arguments: // l / h = Length of cylinder along oriented axis. Default: 1 @@ -1063,11 +1063,11 @@ module xcyl(h, r, d, r1, r2, d1, d2, l, anchor=CENTER) // Creates a cylinder oriented along the Y axis. // // Usage: Typical -// ycyl(l|h, r, ); -// ycyl(l|h, d=, ); -// ycyl(l|h, r1=|d1=, r2=|d2=, ); +// ycyl(l|h, r, [anchor=]); +// ycyl(l|h, d=, [anchor=]); +// ycyl(l|h, r1=|d1=, r2=|d2=, [anchor=]); // Usage: Attaching Children -// ycyl(l|h, r, ) ; +// ycyl(l|h, r, [anchor=]) [attachments]; // // Arguments: // l / h = Length of cylinder along oriented axis. (Default: `1.0`) @@ -1110,11 +1110,11 @@ module ycyl(h, r, d, r1, r2, d1, d2, l, anchor=CENTER) // Creates a cylinder oriented along the Z axis. // // Usage: Typical -// zcyl(l|h, r, ); -// zcyl(l|h, d=, ); -// zcyl(l|h, r1=|d1=, r2=|d2=, ); +// zcyl(l|h, r, [anchor=]); +// zcyl(l|h, d=, [anchor=]); +// zcyl(l|h, r1=|d1=, r2=|d2=, [anchor=]); // Usage: Attaching Children -// zcyl(l|h, r, ) ; +// zcyl(l|h, r, [anchor=]) [attachments]; // // Arguments: // l / h = Length of cylinder along oriented axis. (Default: 1.0) @@ -1151,15 +1151,15 @@ module zcyl(h, r, d, r1, r2, d1, d2, l, anchor=CENTER) // Makes a hollow tube with the given outer size and wall thickness. // // Usage: Typical -// tube(h|l, or, ir,
, ); +// tube(h|l, or, ir, [center], [realign=]); // tube(h|l, or=|od=, ir=|id=, ...); // tube(h|l, ir|id, wall, ...); // tube(h|l, or|od, wall, ...); // tube(h|l, ir1|id1, ir2|id2, wall, ...); // tube(h|l, or1|od1, or2|od2, wall, ...); -// tube(h|l, ir1|id1, ir2|id2, or1|od1, or2|od2, ); +// tube(h|l, ir1|id1, ir2|id2, or1|od1, or2|od2, [realign]); // Usage: Attaching Children -// tube(h|l, or, ir,
) ; +// tube(h|l, or, ir, [center]) [attachments]; // // Arguments: // h / l = height of tube. Default: 1 @@ -1232,14 +1232,14 @@ module tube( // Module: torus() // // Usage: Typical -// torus(r_maj|d_maj, r_min|d_min,
, ...); +// torus(r_maj|d_maj, r_min|d_min, [center], ...); // torus(or|od, ir|id, ...); // torus(r_maj|d_maj, or|od, ...); // torus(r_maj|d_maj, ir|id, ...); // torus(r_min|d_min, or|od, ...); // torus(r_min|d_min, ir|id, ...); // Usage: Attaching Children -// torus(or|od, ir|id, ...) ;; +// torus(or|od, ir|id, ...) [attachments]; // // Description: // Creates a torus shape. @@ -1333,11 +1333,11 @@ module torus( // Function&Module: spheroid() // Usage: Typical -// spheroid(r|d, ,