diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b3c83b9..04e17d1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -62,3 +62,10 @@ jobs: export OPENSCADPATH=$(dirname $GITHUB_WORKSPACE) openscad-docsgen -Tmf *.scad + - name: Checking Tutorials + run: | + cd $GITHUB_WORKSPACE + echo "::add-matcher::.github/openscad_docsgen.json" + export OPENSCADPATH=$(dirname $GITHUB_WORKSPACE) + openscad-mdimggen -T *.scad + diff --git a/.openscad_gendocs_rc b/.openscad_docsgen_rc similarity index 54% rename from .openscad_gendocs_rc rename to .openscad_docsgen_rc index 26a6704..edd01f7 100644 --- a/.openscad_gendocs_rc +++ b/.openscad_docsgen_rc @@ -1,4 +1,7 @@ DocsDirectory: BOSL2.wiki/ +TargetProfile: githubwiki +ProjectName: The Belfry OpenScad Library, v2. (BOSL2) +GenerateDocs: Files, TOC, Index, Topics, CheatSheet IgnoreFiles: affine.scad foo.scad @@ -7,43 +10,45 @@ IgnoreFiles: builtins.scad tmp_*.scad PrioritizeFiles: - constants.scad transforms.scad - distributors.scad - mutators.scad attachments.scad - primitives.scad - shapes.scad shapes2d.scad + shapes3d.scad drawing.scad - masks.scad - math.scad - vectors.scad - arrays.scad - quaternions.scad - affine.scad - coords.scad - geometry.scad - edges.scad - vnf.scad + masks2d.scad + masks3d.scad + distributors.scad + partitions.scad + mutators.scad paths.scad regions.scad - debug.scad - common.scad - strings.scad + vnf.scad beziers.scad - threading.scad - rounding.scad - knurling.scad - partitions.scad rounding.scad skin.scad - hull.scad - triangulation.scad turtle3d.scad + math.scad + linalg.scad + vectors.scad + quaternions.scad + coords.scad + geometry.scad + trigonometry.scad + constants.scad + version.scad + comparisons.scad + lists.scad + utility.scad + strings.scad structs.scad + fnliterals.scad + threading.scad + screws.scad + metric_screws.scad + bottlecaps.scad + screw_drive.scad DefineHeader(BulletList): Side Effects -DefineHeader(Table:Anchor Name|Position): Extra Anchors -DefineHeader(Table:Name|Definition): Terminology +DefineHeader(Table;Headers=Anchor Name|Position): Extra Anchors +DefineHeader(Table;Headers=Name|Definition): Terminology DefineHeader(BulletList): Requirements diff --git a/.openscad_mdimggen_rc b/.openscad_mdimggen_rc new file mode 100644 index 0000000..ef2dee2 --- /dev/null +++ b/.openscad_mdimggen_rc @@ -0,0 +1,5 @@ +docs_dir: "BOSL2.wiki" +image_root: "images/tutorials" +file_prefix: "Tutorial-" +source_files: "tutorials/*.md" + diff --git a/attachments.scad b/attachments.scad index c278b3a..018297c 100644 --- a/attachments.scad +++ b/attachments.scad @@ -7,6 +7,9 @@ // are both written to support attachment. Also included in this file are the tools to make your own "attachable" objects. // Includes: // include +// FileGroup: Basic Modeling +// FileSummary: Positioning objects on or relative to other objects. Making your own objects support attachment. +// FileFootnotes: STD=Included in std.scad ////////////////////////////////////////////////////////////////////// @@ -47,7 +50,7 @@ _ANCHOR_TYPES = ["intersect","hull"]; // all based on combinations of unit direction vectors. You can use these for anchoring and orienting // attachable objects. You can also them to specify edge sets for rounding or chamfering cuboids, // or for placing edge, face and corner masks. -// SubSection: Anchor +// Subsection: Anchor // Anchoring is specified with the `anchor` argument in most shape modules. Specifying `anchor` // when creating an object will translate the object so that the anchor point is at the origin // (0,0,0). Anchoring always occurs before spin and orientation are applied. @@ -76,20 +79,20 @@ _ANCHOR_TYPES = ["intersect","hull"]; // motors have anchors for `"screw1"`, `"screw2"`, etc. to refer to the various screwholes on the // stepper motor shape. The names, positions, directions, and spins of these anchors are // specific to the object, and are documented when they exist. -// SubSection: Spin +// Subsection: Spin // Spin is specified with the `spin` argument in most shape modules. Specifying a scalar `spin` // when creating an object will rotate the object counter-clockwise around the Z axis by the given // number of degrees. If given as a 3D vector, the object will be rotated around each of the X, Y, Z // axes by the number of degrees in each component of the vector. Spin is always applied after // anchoring, and before orientation. Since spin is applied after anchoring it is not what // you might think of intuitively as spinning the shape. To do that, apply `zrot()` to the shape before anchoring. -// SubSection: Orient +// Subsection: Orient // Orientation is specified with the `orient` argument in most shape modules. Specifying `orient` // when creating an object will rotate the object such that the top of the object will be pointed // at the vector direction given in the `orient` argument. Orientation is always applied after // anchoring and spin. The constants `UP`, `DOWN`, `FRONT`, `BACK`, `LEFT`, and `RIGHT` can be // added together to form the directional vector for this. ie: `LEFT+BACK` -// SubSection: Specifying Directions +// Subsection: Specifying Directions // You can use direction vectors to specify anchors for objects or to specify edges, faces, and // corners of cubes. You can simply specify these direction vectors numerically, but another // option is to use named constants for direction vectors. These constants define unit vectors @@ -122,7 +125,7 @@ _ANCHOR_TYPES = ["intersect","hull"]; // up(.12)move(TOP)atext("TOP",size=.1,h=.01,anchor=RIGHT,orient=FRONT); // move(TOP)atext("UP",size=.1,h=.01,anchor=RIGHT,orient=FRONT); // } -// SubSection: Specifying Faces +// Subsection: Specifying Faces // Modules operating on faces accept a list of faces to describe the faces to operate on. Each // face is given by a vector that points to that face. Attachments of cuboid objects onto their faces also // work by choosing an attachment face with a single vector in the same manner. @@ -139,7 +142,7 @@ _ANCHOR_TYPES = ["intersect","hull"]; // _show_cube_faces([LEFT],toplabel=["LEFT"]); // } // } -// SubSection: Specifying Edges +// Subsection: Specifying Edges // Modules operating on edges use two arguments to describe the edge set they will use: The `edges` argument // is a list of edge set descriptors to include in the edge set, and the `except` argument is a list of // edge set descriptors to remove from the edge set. @@ -250,7 +253,7 @@ _ANCHOR_TYPES = ["intersect","hull"]; // _show_edges(_edges([1,-1,1]),toplabel=["edges=[1,-1,1]"]); // _show_edges(_edges([TOP,BOT], TOP+RIGHT+FRONT),toplabel=["edges=[TOP,BOT]","except=TOP+RIGHT+FRONT"]); // } -// SubSection: Specifying Corners +// Subsection: Specifying Corners // Modules operating on corners use two arguments to describe the corner set they will use: The `corners` argument // is a list of corner set descriptors to include in the corner set, and the `except` argument is a list of // corner set descriptors to remove from the corner set. @@ -502,8 +505,6 @@ module attach(from, to, overlap, norot=false) // Description: // Marks all children with the given tags, so that they will `hide()`/`show()`/`diff()` correctly. // This is especially useful for working with children that are not attachment enhanced, such as: -// - `square()` (or use [`rect()`](shapes2d.scad#rect)) -// - `circle()` (or use [`oval()`](shapes2d.scad#oval)) // - `polygon()` // - `text()` // - `projection()` diff --git a/beziers.scad b/beziers.scad index c514df6..d1a2bcb 100644 --- a/beziers.scad +++ b/beziers.scad @@ -4,6 +4,8 @@ // Includes: // include // include +// FileGroup: Advanced Modeling +// FileSummary: Support for bezier curves and surfaces. ////////////////////////////////////////////////////////////////////// // Terminology: @@ -987,8 +989,8 @@ module trace_bezier(bez, width=1, N=3) { color("red") move_copies(bez) if ($idx % N !=0) if (twodim){ - rect([width/2, width*3],center=true); - rect([width*3, width/2],center=true); + rect([width/2, width*3]); + rect([width*3, width/2]); } else { zcyl(d=width/2, h=width*3); xcyl(d=width/2, h=width*3); diff --git a/bottlecaps.scad b/bottlecaps.scad index c753569..00e715a 100644 --- a/bottlecaps.scad +++ b/bottlecaps.scad @@ -4,6 +4,8 @@ // Includes: // include // include +// FileGroup: Threaded Parts +// FileSummary: Standard bottle caps and necks. ////////////////////////////////////////////////////////////////////// diff --git a/comparisons.scad b/comparisons.scad index df9a2f7..8ce1cf6 100644 --- a/comparisons.scad +++ b/comparisons.scad @@ -3,6 +3,9 @@ // Functions for comparisons with lists, ordering and sorting // Includes: // include +// FileGroup: Data Management +// FileSummary: Comparisons and sorting. +// FileFootnotes: STD=Included in std.scad ////////////////////////////////////////////////////////////////////// diff --git a/coords.scad b/coords.scad index 3bc5ca1..9aaeece 100644 --- a/coords.scad +++ b/coords.scad @@ -3,6 +3,9 @@ // Coordinate transformations and coordinate system conversions. // Includes: // include +// FileGroup: Math +// FileSummary: Conversions between coordinate systems. +// FileFootnotes: STD=Included in std.scad ////////////////////////////////////////////////////////////////////// diff --git a/cubetruss.scad b/cubetruss.scad index 542fab5..3a8d85f 100644 --- a/cubetruss.scad +++ b/cubetruss.scad @@ -4,6 +4,8 @@ // Includes: // include // include +// FileGroup: Parts +// FileSummary: Modular open-framed trusses and joiners. ////////////////////////////////////////////////////////////////////////// $cubetruss_size = 30; diff --git a/distributors.scad b/distributors.scad index 3674bbb..8823bd2 100644 --- a/distributors.scad +++ b/distributors.scad @@ -3,6 +3,9 @@ // Functions and modules to distribute children or copies of children. // Includes: // include +// FileGroup: Basic Modeling +// FileSummary: Shortcuts for translation, rotation, etc. Can act on geometry, paths, or can return a matrix. +// FileFootnotes: STD=Included in std.scad ////////////////////////////////////////////////////////////////////// diff --git a/drawing.scad b/drawing.scad index fddaf04..72f27cc 100644 --- a/drawing.scad +++ b/drawing.scad @@ -8,6 +8,9 @@ // and helix() produces helix paths. // Includes: // include +// FileGroup: Basic Modeling +// FileSummary: Attachable cubes, cylinders, spheres, ruler, and text. Many can produce a VNF. +// FileFootnotes: STD=Included in std.scad ////////////////////////////////////////////////////////////////////// diff --git a/fnliterals.scad b/fnliterals.scad index c17563e..678b034 100644 --- a/fnliterals.scad +++ b/fnliterals.scad @@ -4,7 +4,9 @@ // Includes: // include // include -// DefineHeader(Table:Positional|Definition||Named|Definition): FunctionLiteral Args +// FileGroup: Data Management +// FileSummary: Function Literal Algorithms, and factories for generating function literals for builtin functions. +// DefineHeader(Table;Headers=Positional|Definition||Named|Definition): FunctionLiteral Args ////////////////////////////////////////////////////////////////////// diff --git a/gears.scad b/gears.scad index 3cf5b94..607986c 100644 --- a/gears.scad +++ b/gears.scad @@ -6,6 +6,8 @@ // Includes: // include // include +// FileGroup: Parts +// FileSummary: Gears, racks, worms, and worm gears. ////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/geometry.scad b/geometry.scad index 7ee6219..fadf3ad 100644 --- a/geometry.scad +++ b/geometry.scad @@ -6,6 +6,9 @@ // a single endpoint or as segments, bounded by endpoints at both ends. // Includes: // include +// FileGroup: Math +// FileSummary: Line and plane intersections, circles from 3 points, etc. +// FileFootnotes: STD=Included in std.scad ////////////////////////////////////////////////////////////////////// diff --git a/hingesnaps.scad b/hingesnaps.scad index fc0f243..92c0b96 100644 --- a/hingesnaps.scad +++ b/hingesnaps.scad @@ -4,6 +4,8 @@ // Includes: // include // include +// FileGroup: Parts +// FileSummary: Foldable, snap-locking parts. ////////////////////////////////////////////////////////////////////// // Section: Hinges and Snaps diff --git a/joiners.scad b/joiners.scad index 752105a..ad73960 100644 --- a/joiners.scad +++ b/joiners.scad @@ -4,6 +4,8 @@ // Includes: // include // include +// FileGroup: Parts +// FileSummary: Joiner shapes for connecting separately printed objects. ////////////////////////////////////////////////////////////////////// diff --git a/knurling.scad b/knurling.scad index ac7ea76..03f1191 100644 --- a/knurling.scad +++ b/knurling.scad @@ -4,6 +4,8 @@ // Includes: // include // include +// FileGroup: Parts +// FileSummary: Masks and shapes to create knurling. ////////////////////////////////////////////////////////////////////// diff --git a/linalg.scad b/linalg.scad index 69f79ef..9303fad 100644 --- a/linalg.scad +++ b/linalg.scad @@ -5,6 +5,9 @@ // matrix inverse. // Includes: // include +// FileGroup: Math +// FileSummary: Linear Algebra: solve linear systems, construct and modify matrices. +// FileFootnotes: STD=Included in std.scad ////////////////////////////////////////////////////////////////////// // Section: Matrices diff --git a/linear_bearings.scad b/linear_bearings.scad index 8cfee60..88a1426 100644 --- a/linear_bearings.scad +++ b/linear_bearings.scad @@ -4,6 +4,8 @@ // Includes: // include // include +// FileGroup: Parts +// FileSummary: Mounts for LMxUU style linear bearings. ////////////////////////////////////////////////////////////////////// diff --git a/lists.scad b/lists.scad index e7a3533..323b038 100644 --- a/lists.scad +++ b/lists.scad @@ -3,6 +3,9 @@ // Functions for constructing and manipulating generic lists. // Includes: // include +// FileGroup: Data Management +// FileSummary: Various list manipulation functions +// FileFootnotes: STD=Included in std.scad ////////////////////////////////////////////////////////////////////// // Terminology: diff --git a/masks2d.scad b/masks2d.scad index 5c39434..c88701a 100644 --- a/masks2d.scad +++ b/masks2d.scad @@ -6,6 +6,9 @@ // as geometry or as 2D paths. // Includes: // include +// FileGroup: Basic Modeling +// FileSummary: 2D masking shapes for edge profiling: including roundover, cove, teardrop, ogee. +// FileFootnotes: STD=Included in std.scad ////////////////////////////////////////////////////////////////////// diff --git a/masks3d.scad b/masks3d.scad index 82bffee..6c774cc 100644 --- a/masks3d.scad +++ b/masks3d.scad @@ -4,6 +4,9 @@ // edges in three dimensions. // Includes: // include +// FileGroup: Basic Modeling +// FileSummary: 3D masks for rounding edges and corners. +// FileFootnotes: STD=Included in std.scad ////////////////////////////////////////////////////////////////////// diff --git a/math.scad b/math.scad index 7d2f006..44d5f51 100644 --- a/math.scad +++ b/math.scad @@ -3,6 +3,9 @@ // Math helper functions. // Includes: // include +// FileGroup: Math +// FileSummary: General miscellaneous math function. +// FileFootnotes: STD=Included in std.scad ////////////////////////////////////////////////////////////////////// // Section: Math Constants @@ -259,6 +262,8 @@ function u_div(a,b) = // Section: Hyperbolic Trigonometry // Function: sinh() +// Usage: +// a = sinh(x); // Description: Takes a value `x`, and returns the hyperbolic sine of it. function sinh(x) = assert(is_finite(x), "The input must be a finite number.") @@ -266,6 +271,8 @@ function sinh(x) = // Function: cosh() +// Usage: +// a = cosh(x); // Description: Takes a value `x`, and returns the hyperbolic cosine of it. function cosh(x) = assert(is_finite(x), "The input must be a finite number.") @@ -273,6 +280,8 @@ function cosh(x) = // Function: tanh() +// Usage: +// a = tanh(x); // Description: Takes a value `x`, and returns the hyperbolic tangent of it. function tanh(x) = assert(is_finite(x), "The input must be a finite number.") @@ -280,6 +289,8 @@ function tanh(x) = // Function: asinh() +// Usage: +// a = asinh(x); // Description: Takes a value `x`, and returns the inverse hyperbolic sine of it. function asinh(x) = assert(is_finite(x), "The input must be a finite number.") @@ -287,6 +298,8 @@ function asinh(x) = // Function: acosh() +// Usage: +// a = acosh(x); // Description: Takes a value `x`, and returns the inverse hyperbolic cosine of it. function acosh(x) = assert(is_finite(x), "The input must be a finite number.") @@ -294,6 +307,8 @@ function acosh(x) = // Function: atanh() +// Usage: +// a = atanh(x); // Description: Takes a value `x`, and returns the inverse hyperbolic tangent of it. function atanh(x) = assert(is_finite(x), "The input must be a finite number.") diff --git a/metric_screws.scad b/metric_screws.scad index 53e7b8b..142574f 100644 --- a/metric_screws.scad +++ b/metric_screws.scad @@ -4,6 +4,8 @@ // Includes: // include // include +// FileGroup: Threaded Parts +// FileSummary: Metric screws, nuts, and screwholes. ////////////////////////////////////////////////////////////////////// diff --git a/modular_hose.scad b/modular_hose.scad index 2c1c28b..419f45b 100644 --- a/modular_hose.scad +++ b/modular_hose.scad @@ -4,6 +4,8 @@ // Includes: // include // include +// FileGroup: Parts +// FileSummary: Modular flexible hose parts. ////////////////////////////////////////////////////////////////////////// // Section: Modular Hose Parts diff --git a/mutators.scad b/mutators.scad index 2e8aadf..c722df6 100644 --- a/mutators.scad +++ b/mutators.scad @@ -3,6 +3,9 @@ // Functions and modules to mutate children in various ways. // Includes: // include +// FileGroup: Basic Modeling +// FileSummary: Modules and Functions to mutate items. +// FileFootnotes: STD=Included in std.scad ////////////////////////////////////////////////////////////////////// @@ -637,7 +640,7 @@ module cylindrical_extrude(or, ir, od, id, size=1000, convexity=10, spin=0, orie yflip() intersection() { left(x) children(); - rect([quantup(step,pow(2,-15)),size.y],center=true); + rect([quantup(step,pow(2,-15)),size.y]); } } } diff --git a/nema_steppers.scad b/nema_steppers.scad index a1fb256..085fbfd 100644 --- a/nema_steppers.scad +++ b/nema_steppers.scad @@ -4,6 +4,8 @@ // Includes: // include // include +// FileGroup: Parts +// FileSummary: Mounting holes for NEMA motors, and simple motor models. ////////////////////////////////////////////////////////////////////// diff --git a/partitions.scad b/partitions.scad index 4688575..5cca96b 100644 --- a/partitions.scad +++ b/partitions.scad @@ -4,6 +4,8 @@ // Includes: // include // include +// FileGroup: Advanced Modeling +// FileSummary: Modules to help partition large objects into smaller assembled parts. ////////////////////////////////////////////////////////////////////// diff --git a/paths.scad b/paths.scad index 0c8f8cf..70e6158 100644 --- a/paths.scad +++ b/paths.scad @@ -9,6 +9,9 @@ // path tangents and normals, resampling of paths, and cutting paths up into smaller paths. // Includes: // include +// FileGroup: Advanced Modeling +// FileSummary: Work with arbitrary 2D or 3D paths. +// FileFootnotes: STD=Included in std.scad ////////////////////////////////////////////////////////////////////// // Section: Utility Functions diff --git a/polyhedra.scad b/polyhedra.scad index be5f62a..4e565d2 100644 --- a/polyhedra.scad +++ b/polyhedra.scad @@ -4,6 +4,8 @@ // Includes: // include // include +// FileGroup: Parts +// FileSummary: Platonic, Archimidean, Catalan, and stellated polyhedra. ////////////////////////////////////////////////////////////////////// diff --git a/quaternions.scad b/quaternions.scad index 7598655..88cd84f 100644 --- a/quaternions.scad +++ b/quaternions.scad @@ -3,6 +3,9 @@ // Support for Quaternions. // Includes: // include +// FileGroup: Math +// FileSummary: Quaternion based rotations that avoid gimbal lock issues. +// FileFootnotes: STD=Included in std.scad /////////////////////////////////////////// diff --git a/regions.scad b/regions.scad index a88b766..5fbc38c 100644 --- a/regions.scad +++ b/regions.scad @@ -8,6 +8,9 @@ // region and you can decompose a region into parts. // Includes: // include +// FileGroup: Advanced Modeling +// FileSummary: Offsets and boolean geometry of 2D paths and regions. +// FileFootnotes: STD=Included in std.scad ////////////////////////////////////////////////////////////////////// @@ -288,7 +291,7 @@ function force_region(poly) = is_path(poly) ? [poly] : poly; // anchor = Translate so anchor point is at origin (0,0,0). See [anchor](attachments.scad#subsection-anchor). Default: `"origin"` // spin = Rotate this many degrees after anchor. See [spin](attachments.scad#subsection-spin). Default: `0` // cp = Centerpoint for determining intersection anchors or centering the shape. Determintes the base of the anchor vector. Can be "centroid", "mean", "box" or a 2D point. Default: "centroid" -// atype = Set to "hull" or "intersect to select anchor type. Default: "hull" +// atype = Set to "hull" or "intersect" to select anchor type. Default: "hull" // Example(2D): Displaying a region // region([circle(d=50), square(25,center=true)]); // Example(2D): Displaying a list of polygons that intersect each other, which is not a region @@ -328,10 +331,14 @@ module region(r, anchor="origin", spin=0, cp="centroid", atype="hull") // point = The point to test. // region = The region to test against, as a list of polygon paths. // eps = Acceptable variance. Default: `EPSILON` (1e-9) -// Example(2D,NoAxes): Green points are in the region, red ones are outside -// region = [for(i=[2:8]) hexagon(r=i)]; -// region(region); -// for(x=[-4.5:4.5],y=[-4.5:4.5]) color(point_in_region([x,y],region)==1?"green":"red") move([x,y])circle(r=.1,$fn=12); +// Example(2D,Med): Red points are in the region. +// region = [for(i=[2:4:10]) hexagon(r=i)]; +// color("#ff7") region(region); +// for(x=[-10:10], y=[-10:10]) +// if (point_in_region([x,y], region)>=0) +// move([x,y]) color("red") circle(0.15, $fn=12); +// else +// move([x,y]) color("#ddf") circle(0.1, $fn=12); function point_in_region(point, region, eps=EPSILON) = let(region=force_region(region)) assert(is_region(region), "Region given to point_in_region is not a region") diff --git a/rounding.scad b/rounding.scad index 1e9eb86..7aecea7 100644 --- a/rounding.scad +++ b/rounding.scad @@ -5,6 +5,8 @@ // Includes: // include // include +// FileGroup: Advanced Modeling +// FileSummary: Round path corners, rounded prisms, rounded cutouts in tubes. ////////////////////////////////////////////////////////////////////// include include diff --git a/screw_drive.scad b/screw_drive.scad index 267d90a..1c72b68 100644 --- a/screw_drive.scad +++ b/screw_drive.scad @@ -4,6 +4,8 @@ // Includes: // include // include +// FileGroup: Threaded Parts +// FileSummary: Masks for Phillips/Torx/etc driver holes. ////////////////////////////////////////////////////////////////////// @@ -15,6 +17,7 @@ // be lowered to different depths to create different sizes of recess. // Arguments: // size = The size of the bit as a number or string. "#0", "#1", "#2", "#3", or "#4" +// --- // anchor = Translate so anchor point is at origin (0,0,0). See [anchor](attachments.scad#subsection-anchor). Default: `CENTER` // spin = Rotate this many degrees around the Z axis after anchor. See [spin](attachments.scad#subsection-spin). Default: `0` // orient = Vector to rotate top towards, after spin. See [orient](attachments.scad#subsection-orient). Default: `UP` @@ -29,26 +32,24 @@ // Specs for phillips recess here: // https://www.fasteners.eu/tech-info/ISO/4757/ -_phillips_shaft = [3,4.5,6,8,10]; -_ph_bot_angle = 28.0; -_ph_side_angle = 26.5; +function _phillips_shaft(x) = [3,4.5,6,8,10][x]; +function _ph_bot_angle() = 28.0; +function _ph_side_angle() = 26.5; module phillips_mask(size="#2", $fn=36, anchor=BOTTOM, spin=0, orient=UP) { assert(in_list(size,["#0","#1","#2","#3","#4",0,1,2,3,4])); num = is_num(size) ? size : ord(size[1]) - ord("0"); - shaft = _phillips_shaft[num]; + shaft = _phillips_shaft(num); b = [0.61, 0.97, 1.47, 2.41, 3.48][num]; e = [0.31, 0.435, 0.815, 2.005, 2.415][num]; g = [0.81, 1.27, 2.29, 3.81, 5.08][num]; - //f = [0.33, 0.53, 0.70, 0.82, 1.23][num]; - //r = [0.30, 0.50, 0.60, 0.80, 1.00][num]; alpha = [ 136, 138, 140, 146, 153][num]; beta = [7.00, 7.00, 5.75, 5.75, 7.00][num]; gamma = 92.0; - h1 = adj_ang_to_opp(g/2, _ph_bot_angle); // height of the small conical tip - h2 = adj_ang_to_opp((shaft-g)/2, 90-_ph_side_angle); // height of larger cone + h1 = adj_ang_to_opp(g/2, _ph_bot_angle()); // height of the small conical tip + h2 = adj_ang_to_opp((shaft-g)/2, 90-_ph_side_angle()); // height of larger cone l = h1+h2; - h3 = adj_ang_to_opp(b/2, _ph_bot_angle); // height where cutout starts + h3 = adj_ang_to_opp(b/2, _ph_bot_angle()); // height where cutout starts p0 = [0,0]; p1 = [adj_ang_to_opp(e/2, 90-alpha/2), -e/2]; p2 = p1 + [adj_ang_to_opp((shaft-e)/2, 90-gamma/2),-(shaft-e)/2]; @@ -92,13 +93,11 @@ function phillips_depth(size, d) = num = is_num(size) ? size : ord(size[1]) - ord("0"), shaft = [3,4.5,6,8,10][num], g = [0.81, 1.27, 2.29, 3.81, 5.08][num], - _ph_bot_angle = 28.0, - _ph_side_angle = 26.5, - h1 = adj_ang_to_opp(g/2, _ph_bot_angle), // height of the small conical tip - h2 = adj_ang_to_opp((shaft-g)/2, 90-_ph_side_angle) // height of larger cone + h1 = adj_ang_to_opp(g/2, _ph_bot_angle()), // height of the small conical tip + h2 = adj_ang_to_opp((shaft-g)/2, 90-_ph_side_angle()) // height of larger cone ) d>=shaft || d= h1+h2 ? undef : - 2 * tan(_ph_side_angle)*(depth-h1) + g; + 2 * tan(_ph_side_angle())*(depth-h1) + g; @@ -128,6 +127,8 @@ function phillips_diam(size, depth) = // Function: torx_outer_diam() +// Usage: +// diam = torx_outer_diam(size); // Description: Get the typical outer diameter of Torx profile. // Arguments: // size = Torx size. @@ -152,6 +153,8 @@ function torx_outer_diam(size) = lookup(size, [ // Function: torx_inner_diam() +// Usage: +// diam = torx_inner_diam(size); // Description: Get typical inner diameter of Torx profile. // Arguments: // size = Torx size. @@ -176,6 +179,8 @@ function torx_inner_diam(size) = lookup(size, [ // Function: torx_depth() +// Usage: +// depth = torx_depth(size); // Description: Gets typical drive hole depth. // Arguments: // size = Torx size. @@ -200,6 +205,8 @@ function torx_depth(size) = lookup(size, [ // Function: torx_tip_radius() +// Usage: +// rad = torx_tip_radius(size); // Description: Gets minor rounding radius of Torx profile. // Arguments: // size = Torx size. @@ -224,6 +231,8 @@ function torx_tip_radius(size) = lookup(size, [ // Function: torx_rounding_radius() +// Usage: +// rad = torx_rounding_radius(size); // Description: Gets major rounding radius of Torx profile. // Arguments: // size = Torx size. @@ -249,6 +258,8 @@ function torx_rounding_radius(size) = lookup(size, [ // Module: torx_mask2d() +// Usage: +// torx_mask2d(size); // Description: Creates a torx bit 2D profile. // Arguments: // size = Torx size. @@ -287,11 +298,14 @@ module torx_mask2d(size) { // Module: torx_mask() +// Usage: +// torx_mask(size, l, [center]); // Description: Creates a torx bit tip. // Arguments: // size = Torx size. // l = Length of bit. // center = If true, centers bit vertically. +// --- // anchor = Translate so anchor point is at origin (0,0,0). See [anchor](attachments.scad#subsection-anchor). Default: `CENTER` // spin = Rotate this many degrees around the Z axis after anchor. See [spin](attachments.scad#subsection-spin). Default: `0` // orient = Vector to rotate top towards, after spin. See [orient](attachments.scad#subsection-orient). Default: `UP` diff --git a/screws.scad b/screws.scad index f9bec1f..79a9b20 100644 --- a/screws.scad +++ b/screws.scad @@ -4,6 +4,8 @@ // Includes: // include // include +// FileGroup: Threaded Parts +// FileSummary: ISO (metric) and UTS screws and nuts. ////////////////////////////////////////////////////////////////////// include @@ -783,7 +785,7 @@ module screw_head(screw_info,details=false) { intersection(){ arc(points=[[-head_size2/2,0], [0,-base+head_height * (head=="button"?4/3:1)], [head_size2/2,0]]); square([head_size2, head_height-base]); - } + } } if (head=="pan flat") cyl(l=head_height, d=head_size, rounding2=0.2*head_size, anchor=BOTTOM); @@ -1238,7 +1240,6 @@ module _rod(spec, length, tolerance, orient=UP, spin=0, anchor=CENTER) { threadspec = thread_specification(spec, internal=false, tolerance=tolerance); echo(d_major_mean = mean(struct_val(threadspec, "d_major"))); - echo(bolt_profile=_thread_profile(threadspec)); threaded_rod([mean(struct_val(threadspec, "d_minor")), mean(struct_val(threadspec, "d_pitch")), diff --git a/scripts/make_tutorials.sh b/scripts/make_tutorials.sh deleted file mode 100755 index b728607..0000000 --- a/scripts/make_tutorials.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash - -DISPMD=0 -GEN_ARGS=() -FILES=() -for opt in "$@" ; do - case "$opt" in - -f ) GEN_ARGS+=(-f) ;; - -d ) DISPMD=1 ;; - -* ) echo "Unknown option $opt" >&2; exit 1 ;; - * ) FILES+=("$opt") ;; - esac -done - -if (( ${#FILES[@]} == 0 )); then - FILES=(Shapes2d Shapes3d Transforms Distributors Mutators Attachments Paths FractalTree) -fi - -# Try to cd to the BOSL2.wiki directory if run from the BOSL2 root -if [[ "$(basename "$PWD")" != "BOSL2.wiki" ]]; then - if ! cd BOSL2.wiki; then - echo "BOSL2.wiki directory not found, try running from the BOSL2 or BOSL2/BOSL2.wiki directory" >&2 - exit 1 - fi -fi - -rm -f tmp_*.scad -for base in "${FILES[@]}"; do - base="$(basename "$base" .md)" - mkdir -p images/tutorials - rm -f "images/tutorials/${base}"_*.png "images/tutorials/${base}"_*.gif - echo "${base}.md" - ../scripts/tutorial_gen.py "../tutorials/${base}.md" -o "Tutorial-${base}.md" "${GEN_ARGS[@]}" -I images/tutorials/ || exit 1 - if (( DISPMD )); then - open -a Typora "Tutorial-${base}.md" - fi -done - - diff --git a/scripts/tutorial_gen.py b/scripts/tutorial_gen.py deleted file mode 100755 index 6e6d62c..0000000 --- a/scripts/tutorial_gen.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env python3 - -from __future__ import print_function - -import os -import sys -import os.path -import argparse - -from openscad_docsgen.imagemanager import ImageManager - - -imgmgr = ImageManager() - - -def img_started(req): - print(" {}... ".format(os.path.basename(req.image_file)), end='') - sys.stdout.flush() - - -def img_completed(req): - if req.success: - if req.status == "SKIP": - print() - else: - print(req.status) - sys.stdout.flush() - return - out = "\n\n" - for line in req.echos: - out += line + "\n" - for line in req.warnings: - out += line + "\n" - for line in req.errors: - out += line + "\n" - out += "//////////////////////////////////////////////////////////////////////\n" - out += "// LibFile: {} Line: {} Image: {}\n".format( - req.src_file, req.src_line, os.path.basename(req.image_file) - ) - out += "//////////////////////////////////////////////////////////////////////\n" - for line in req.script_lines: - out += line + "\n" - out += "//////////////////////////////////////////////////////////////////////\n" - print(out, file=sys.stderr) - sys.exit(-1) - - -def processFile(infile, outfile=None, imgroot=""): - if imgroot and not imgroot.endswith('/'): - imgroot += "/" - fileroot = os.path.splitext(os.path.basename(infile))[0] - - outdata = [] - with open(infile, "r") as f: - script = ["include "] - extyp = "" - in_script = False - imgnum = 0 - show_script = True - linenum = -1 - for line in f.readlines(): - linenum += 1 - line = line.rstrip("\n") - if line.startswith("```openscad"): - in_script = True; - if "-" in line: - extyp = line.split("-")[1] - else: - extyp = "" - show_script = "ImgOnly" not in extyp - script = ["include "] - imgnum = imgnum + 1 - elif in_script: - if line == "```": - in_script = False - fext = "png" - if any(x in extyp for x in ("Anim", "Spin")): - fext = "gif" - imgfile = os.path.join(imgroot, "{}_{}.{}".format(fileroot, imgnum, fext)) - imgmgr.new_request( - fileroot+".md", linenum, - imgfile, script, extyp, - starting_cb=img_started, - completion_cb=img_completed - ) - if show_script: - outdata.append("```openscad") - outdata.extend(script) - outdata.append("```") - outdata.append("![Figure {}]({})".format(imgnum, imgfile)) - show_script = True - extyp = "" - else: - script.append(line) - else: - outdata.append(line) - - if outfile == None: - f = sys.stdout - else: - f = open(outfile, "w") - - for line in outdata: - print(line, file=f) - - if outfile: - f.close() - - -def main(): - parser = argparse.ArgumentParser(prog='docs_gen') - parser.add_argument('-I', '--imgroot', default="", - help='The directory to put generated images in.') - parser.add_argument('-o', '--outfile', - help='Output file, if different from infile.') - parser.add_argument('infile', help='Input filename.') - args = parser.parse_args() - - processFile( - args.infile, - outfile=args.outfile, - imgroot=args.imgroot - ) - imgmgr.process_requests() - - sys.exit(0) - - -if __name__ == "__main__": - main() - - -# vim: expandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap diff --git a/shapes2d.scad b/shapes2d.scad index ee69b64..cbfd98b 100644 --- a/shapes2d.scad +++ b/shapes2d.scad @@ -10,6 +10,9 @@ // function forms that produce a path. // Includes: // include +// FileGroup: Basic Modeling +// FileSummary: Attachable circles, squares, polygons, teardrop. Can make geometry or paths. +// FileFootnotes: STD=Included in std.scad ////////////////////////////////////////////////////////////////////// use @@ -109,7 +112,7 @@ module rect(size=1, rounding=0, chamfer=0, anchor=CENTER, spin=0) { children(); } } else { - pts = rect(size=size, rounding=rounding, chamfer=chamfer, center=true); + pts = rect(size=size, rounding=rounding, chamfer=chamfer); attachable(anchor, spin, two_d=true, path=pts) { polygon(pts); children(); diff --git a/shapes3d.scad b/shapes3d.scad index 4cf94ba..e81f9d6 100644 --- a/shapes3d.scad +++ b/shapes3d.scad @@ -7,6 +7,9 @@ // so you can place it on a curved object. // Includes: // include +// FileGroup: Basic Modeling +// FileSummary: Attachable cubes, cylinders, spheres, ruler, and text. Many can produce a VNF. +// FileFootnotes: STD=Included in std.scad ////////////////////////////////////////////////////////////////////// use diff --git a/skin.scad b/skin.scad index 7662a2e..ca41a92 100644 --- a/skin.scad +++ b/skin.scad @@ -9,6 +9,9 @@ // - https://github.com/openscad/list-comprehension-demos/blob/master/skin.scad // Includes: // include +// FileGroup: Advanced Modeling +// FileSummary: Construct 3D shapes from a 2D cross sections of the desired shape. +// FileFootnotes: STD=Included in std.scad ////////////////////////////////////////////////////////////////////// diff --git a/sliders.scad b/sliders.scad index 5b5685a..5f18955 100644 --- a/sliders.scad +++ b/sliders.scad @@ -4,6 +4,8 @@ // Includes: // include // include +// FileGroup: Parts +// FileSummary: Simple sliders and rails. ////////////////////////////////////////////////////////////////////// diff --git a/strings.scad b/strings.scad index 26ec444..e9b2b25 100644 --- a/strings.scad +++ b/strings.scad @@ -3,6 +3,9 @@ // String manipulation and formatting functions. // Includes: // include +// FileGroup: Data Management +// FileSummary: String manipulation functions. +// FileFootnotes: STD=Included in std.scad ////////////////////////////////////////////////////////////////////// diff --git a/structs.scad b/structs.scad index 3352a2e..5acba95 100644 --- a/structs.scad +++ b/structs.scad @@ -4,6 +4,8 @@ // Includes: // include // include +// FileGroup: Data Management +// FileSummary: Structure/Dictionary Manipulation ////////////////////////////////////////////////////////////////////// diff --git a/threading.scad b/threading.scad index 8bec1e2..fd03d9f 100644 --- a/threading.scad +++ b/threading.scad @@ -4,6 +4,8 @@ // Includes: // include // include +// FileGroup: Threaded Parts +// FileSummary: Various types of threaded rods and nuts. ////////////////////////////////////////////////////////////////////// diff --git a/transforms.scad b/transforms.scad index 77b4f90..b9d9380 100644 --- a/transforms.scad +++ b/transforms.scad @@ -15,6 +15,9 @@ // operate on. The exceptions are rot(), frame_map() and skew(). // Includes: // include +// FileGroup: Basic Modeling +// FileSummary: Shortcuts for translation, rotation, etc. Can act on geometry, paths, or can return a matrix. +// FileFootnotes: STD=Included in std.scad ////////////////////////////////////////////////////////////////////// diff --git a/trigonometry.scad b/trigonometry.scad index 07a35f1..a48e432 100644 --- a/trigonometry.scad +++ b/trigonometry.scad @@ -4,6 +4,9 @@ // all the function relations, or silly acronyms like SOHCAHTOA. // Includes: // include +// FileGroup: Math +// FileSummary: Trigonometry shortcuts for when you can't recall the mnemonic SOHCAHTOA. +// FileFootnotes: STD=Included in std.scad ////////////////////////////////////////////////////////////////////// diff --git a/turtle3d.scad b/turtle3d.scad index 2d42c06..27cdc25 100644 --- a/turtle3d.scad +++ b/turtle3d.scad @@ -5,6 +5,8 @@ // Includes: // include // include +// FileGroup: Advanced Modeling +// FileSummary: 3D turtle graphics for making paths or lists of transformations. ////////////////////////////////////////////////////////////////////// include diff --git a/tutorials/Attachments.md b/tutorials/Attachments.md index 53cfa04..38ba93e 100644 --- a/tutorials/Attachments.md +++ b/tutorials/Attachments.md @@ -958,7 +958,7 @@ stellate_cube() show_anchors(50); ```openscad-3D $fn=32; R = difference(circle(10), right(2, circle(9))); -linear_sweep(R,height=10,anchor_isect=true) +linear_sweep(R,height=10,atype="hull") attach(RIGHT) anchor_arrow(); ``` diff --git a/tutorials/Paths.md b/tutorials/Paths.md index bcba35c..d8abf57 100644 --- a/tutorials/Paths.md +++ b/tutorials/Paths.md @@ -136,7 +136,7 @@ stroke(path, closed=true, endcap2="arrow2"); ``` ```openscad-2D -path = rect([40,30], rounding=5, center=true); +path = rect([40,30], rounding=5); stroke(path, closed=true, endcap2="arrow2"); ``` @@ -151,7 +151,7 @@ stroke(path, closed=true, endcap2="arrow2"); ``` ```openscad-2D -path = oval(d=[50,30]); +path = ellipse(d=[50,30]); stroke(path, closed=true, endcap2="arrow2"); ``` diff --git a/tutorials/Shapes2d.md b/tutorials/Shapes2d.md index 122f103..27b0d22 100644 --- a/tutorials/Shapes2d.md +++ b/tutorials/Shapes2d.md @@ -28,13 +28,13 @@ You can use it in the same way you use `square()`, but it also provides extended functionality. For example, it allows you to round the corners: ```openscad-2D -rect([60,40], center=true, rounding=10); +rect([60,40], rounding=10); ``` Or chamfer them: ```openscad-2D -rect([60,40], center=true, chamfer=10); +rect([60,40], chamfer=10); ``` You can even specify *which* corners get rounded or chamfered. If you pass a @@ -52,18 +52,18 @@ translate([ 50, 50]) text3d("I"); translate([-50, 50]) text3d("II"); translate([-50,-50]) text3d("III"); translate([ 50,-50]) text3d("IV"); -rect([90,80], center=true); +rect([90,80]); ``` If a size is given as `0`, then there is no rounding and/or chamfering for that quadrant's corner: ```openscad-2D -rect([60,40], center=true, rounding=[0,5,10,15]); +rect([60,40], rounding=[0,5,10,15]); ``` ```openscad-2D -rect([60,40], center=true, chamfer=[0,5,10,15]); +rect([60,40], chamfer=[0,5,10,15]); ``` You can give both `rounding=` and `chamfer=` arguments to mix rounding and @@ -71,15 +71,14 @@ chamfering, but only if you specify per corner. If you want a rounding in a corner, specify a 0 chamfer for that corner, and vice versa: ```openscad-2D -rect([60,40], center=true, rounding=[5,0,10,0], chamfer=[0,5,0,15]); +rect([60,40], rounding=[5,0,10,0], chamfer=[0,5,0,15]); ``` #### Anchors and Spin Another way that `rect()` is enhanced over `square()`, is that you can anchor, spin and attach it. -The `anchor=` argument is an alternative to `center=`, which allows more -alignment options. It takes a vector as a value, pointing roughly towards +The `anchor=` argument takes a vector as a value, pointing roughly towards the side or corner you want to align to the origin. For example, to align the center of the back edge to the origin, set the anchor to `[0,1]`: @@ -145,7 +144,7 @@ rect([60,40], anchor=BACK, spin=30); Anchor points double as attachment points, so that you can attach other shapes: ```openscad-2D -rect([60,40],center=true) +rect([60,40]) show_anchors(); ``` @@ -164,7 +163,7 @@ circle(d=100); circle(d=100, $fn=8); ``` -The BOSL2 library also provides an enhanced equivalent of `circle()` called `oval()`. +The BOSL2 library also provides an enhanced equivalent of `circle()` called `ellipse()`. You can use it in the same way you use `circle()`, but it also provides extended functionality. For example, it allows more control over its size and orientation. @@ -172,22 +171,22 @@ Since a circle in OpenSCAD can only be approximated by a regular polygon with a number of straight sides, this can lead to size and shape inaccuracies. To counter this, the `realign=` and `circum=` arguments are also provided. -The `realign=` argument, if set `true`, rotates the `oval()` by half the angle +The `realign=` argument, if set `true`, rotates the `ellipse()` by half the angle between the sides: ```openscad-2D -oval(d=100, $fn=8, realign=true); +ellipse(d=100, $fn=8, realign=true); ``` The `circum=` argument, if true, makes it so that the polygon forming the -`oval()` circumscribes the ideal circle instead of inscribing it. +`ellipse()` circumscribes the ideal circle instead of inscribing it. Inscribing the ideal circle: ```openscad-2D difference() { circle(d=100, $fn=360); - oval(d=100, $fn=8); + ellipse(d=100, $fn=8); } ``` @@ -195,39 +194,39 @@ Circumscribing the ideal circle: ```openscad-2D difference() { - oval(d=100, $fn=8, circum=true); + ellipse(d=100, $fn=8, circum=true); circle(d=100, $fn=360); } ``` -The `oval()` module, as its name suggests, can be given separate X and Y radii +The `ellipse()` module, as its name suggests, can be given separate X and Y radii or diameters. To do this, just give `r=` or `d=` with a list of two radii or diameters: ```openscad-2D -oval(r=[30,20]); +ellipse(r=[30,20]); ``` ```openscad-2D -oval(d=[60,40]); +ellipse(d=[60,40]); ``` -Another way that `oval()` is enhanced over `circle()`, is that you can anchor, +Another way that `ellipse()` is enhanced over `circle()`, is that you can anchor, spin and attach it. ```openscad-2D -oval(r=50, anchor=BACK); +ellipse(r=50, anchor=BACK); ``` ```openscad-2D -oval(r=50, anchor=FRONT+RIGHT); +ellipse(r=50, anchor=FRONT+RIGHT); ``` Using spin on a circle may not make initial sense, until you remember that anchoring is performed before spin: ```openscad-2D -oval(r=50, anchor=FRONT, spin=-30); +ellipse(r=50, anchor=FRONT, spin=-30); ``` @@ -349,7 +348,7 @@ They also have somewhat different attachment behavior: ```openscad-2D color("green") stroke(circle(d=50), closed=true); -oval(d=50,$fn=5) +ellipse(d=50,$fn=5) attach(LEFT) color("blue") anchor_arrow2d(); ``` diff --git a/utility.scad b/utility.scad index 9e9dadd..a9c66be 100644 --- a/utility.scad +++ b/utility.scad @@ -3,6 +3,9 @@ // Utility functions used in argument processing. // Includes: // include +// FileGroup: Data Management +// FileSummary: Helpers for argument processing. +// FileFootnotes: STD=Included in std.scad ////////////////////////////////////////////////////////////////////// diff --git a/vectors.scad b/vectors.scad index 819b2bc..51601a4 100644 --- a/vectors.scad +++ b/vectors.scad @@ -3,6 +3,9 @@ // Vector math functions. // Includes: // include +// FileGroup: Math +// FileSummary: Vector math functions. +// FileFootnotes: STD=Included in std.scad ////////////////////////////////////////////////////////////////////// @@ -63,6 +66,8 @@ function add_scalar(v,s) = // Function: v_mul() +// Usage: +// v3 = v_mul(v1, v2); // Description: // Element-wise multiplication. Multiplies each element of `v1` by the corresponding element of `v2`. // Both `v1` and `v2` must be the same length. Returns a vector of the products. @@ -77,6 +82,8 @@ function v_mul(v1, v2) = // Function: v_div() +// Usage: +// v3 = v_div(v1, v2); // Description: // Element-wise vector division. Divides each element of vector `v1` by // the corresponding element of vector `v2`. Returns a vector of the quotients. @@ -91,6 +98,8 @@ function v_div(v1, v2) = // Function: v_abs() +// Usage: +// v2 = v_abs(v); // Description: Returns a vector of the absolute value of each element of vector `v`. // Arguments: // v = The vector to get the absolute values of. @@ -102,6 +111,8 @@ function v_abs(v) = // Function: v_floor() +// Usage: +// v2 = v_floor(v); // Description: // Returns the given vector after performing a `floor()` on all items. function v_floor(v) = @@ -110,6 +121,8 @@ function v_floor(v) = // Function: v_ceil() +// Usage: +// v2 = v_ceil(v); // Description: // Returns the given vector after performing a `ceil()` on all items. function v_ceil(v) = @@ -118,6 +131,8 @@ function v_ceil(v) = // Function: v_lookup() +// Usage: +// v2 = v_ceil(x, v); // Description: // Works just like the built-in function [`lookup()`](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Mathematical_Functions#lookup), except that it can also interpolate between vector result values of the same length. // Arguments: @@ -147,7 +162,7 @@ function v_lookup(x, v) = // Function: unit() // Usage: -// unit(v, [error]); +// v = unit(v, [error]); // Description: // Returns the unit length normalized version of vector v. If passed a zero-length vector, // asserts an error unless `error` is given, in which case the value of `error` is returned. @@ -180,10 +195,10 @@ function v_theta(v) = // Function: vector_angle() // Usage: -// vector_angle(v1,v2); -// vector_angle([v1,v2]); -// vector_angle(PT1,PT2,PT3); -// vector_angle([PT1,PT2,PT3]); +// ang = vector_angle(v1,v2); +// ang = vector_angle([v1,v2]); +// ang = vector_angle(PT1,PT2,PT3); +// ang = vector_angle([PT1,PT2,PT3]); // Description: // If given a single list of two vectors, like `vector_angle([V1,V2])`, returns the angle between the two vectors V1 and V2. // If given a single list of three points, like `vector_angle([A,B,C])`, returns the angle between the line segments AB and BC. @@ -222,10 +237,10 @@ function vector_angle(v1,v2,v3) = // Function: vector_axis() // Usage: -// vector_axis(v1,v2); -// vector_axis([v1,v2]); -// vector_axis(PT1,PT2,PT3); -// vector_axis([PT1,PT2,PT3]); +// axis = vector_axis(v1,v2); +// axis = vector_axis([v1,v2]); +// axis = vector_axis(PT1,PT2,PT3); +// axis = vector_axis([PT1,PT2,PT3]); // Description: // If given a single list of two vectors, like `vector_axis([V1,V2])`, returns the vector perpendicular the two vectors V1 and V2. // If given a single list of three points, like `vector_axis([A,B,C])`, returns the vector perpendicular to the plane through a, B and C. @@ -487,7 +502,7 @@ function _bt_tree(points, ind, leafsize=25) = // Function: vector_nearest() // Usage: -// indices = vector_nearest(query, k, target) +// indices = vector_nearest(query, k, target); // See Also: vector_search(), vector_search_tree() // Description: // Search `target` for the `k` points closest to point `query`. @@ -560,8 +575,8 @@ function _insert_sorted(list, k, new) = function _insert_many(list, k, newlist,i=0) = i==len(newlist) - ? list - : assert(is_vector(newlist[i],2), "The tree is invalid.") + ? list + : assert(is_vector(newlist[i],2), "The tree is invalid.") _insert_many(_insert_sorted(list,k,newlist[i]),k,newlist,i+1); diff --git a/version.scad b/version.scad index 0de9998..0ec7df5 100644 --- a/version.scad +++ b/version.scad @@ -3,6 +3,9 @@ // File that provides functions to manage versioning. // Includes: // include +// FileGroup: Data Management +// FileSummary: Parse and compare semantic versions. +// FileFootnotes: STD=Included in std.scad ////////////////////////////////////////////////////////////////////// diff --git a/vnf.scad b/vnf.scad index 0abec25..fb7705a 100644 --- a/vnf.scad +++ b/vnf.scad @@ -6,6 +6,9 @@ // reversed faces. // Includes: // include +// FileGroup: Advanced Modeling +// FileSummary: Vertices 'n' Faces structure. Makes polyhedron() easier to use. +// FileFootnotes: STD=Included in std.scad ////////////////////////////////////////////////////////////////////// @@ -1067,8 +1070,8 @@ function _triangulate_planar_convex_polygons(polys) = // bent2 = vnf_bend(vnf2, axis="Y"); // vnf_polyhedron([bent1,bent2]); // Example(3D): -// rgn = union(rect([100,20],center=true), -// rect([20,100],center=true)); +// rgn = union(rect([100,20]), +// rect([20,100])); // vnf0 = linear_sweep(zrot(45,p=rgn), height=10); // vnf1 = up(50, p=vnf0); // vnf2 = down(50, p=vnf0); @@ -1077,7 +1080,7 @@ function _triangulate_planar_convex_polygons(polys) = // vnf_polyhedron([bent1,bent2]); // Example(3D): Bending Around X Axis. // rgnr = union( -// rect([20,100],center=true), +// rect([20,100]), // back(50, p=trapezoid(w1=40, w2=0, h=20, anchor=FRONT)) // ); // vnf0 = xrot(00,p=linear_sweep(rgnr, height=10)); @@ -1087,7 +1090,7 @@ function _triangulate_planar_convex_polygons(polys) = // vnf_polyhedron([bent1]); // Example(3D): Bending Around Y Axis. // rgn = union( -// rect([20,100],center=true), +// rect([20,100]), // back(50, p=trapezoid(w1=40, w2=0, h=20, anchor=FRONT)) // ); // rgnr = zrot(-90, p=rgn); @@ -1098,7 +1101,7 @@ function _triangulate_planar_convex_polygons(polys) = // vnf_polyhedron([bent1]); // Example(3D): Bending Around Z Axis. // rgn = union( -// rect([20,100],center=true), +// rect([20,100]), // back(50, p=trapezoid(w1=40, w2=0, h=20, anchor=FRONT)) // ); // rgnr = zrot(90, p=rgn); diff --git a/walls.scad b/walls.scad index ad1ace5..333f21d 100644 --- a/walls.scad +++ b/walls.scad @@ -4,6 +4,8 @@ // Includes: // include // include +// FileGroup: Parts +// FileSummary: Walls and structural elements that 3D print without support. ////////////////////////////////////////////////////////////////////// diff --git a/wiring.scad b/wiring.scad index 0eb1266..1f1fc7e 100644 --- a/wiring.scad +++ b/wiring.scad @@ -4,6 +4,8 @@ // Includes: // include // include +// FileGroup: Parts +// FileSummary: Routed bundles of wires. //////////////////////////////////////////////////////////////////////