From a1a178ea05be81b8e306a36596e4edd5dbd5422d Mon Sep 17 00:00:00 2001 From: Revar Desmera Date: Tue, 4 Apr 2023 20:29:21 -0700 Subject: [PATCH] Reviewed gears.scad and cubetruss.scad for Usage --- cubetruss.scad | 22 +++++++++---------- gears.scad | 58 ++++++++++++++++++++++++++++++-------------------- 2 files changed, 46 insertions(+), 34 deletions(-) diff --git a/cubetruss.scad b/cubetruss.scad index 7f01417..e0e16b9 100644 --- a/cubetruss.scad +++ b/cubetruss.scad @@ -21,15 +21,15 @@ $cubetruss_clip_thickness = 1.6; // Topics: Trusses, CubeTruss, FDM Optimized, Parts // See Also: cubetruss_segment(), cubetruss_support(), cubetruss(), cubetruss_corner() // Usage: -// cubetruss(extents, [clips], [bracing], [size], [strut], [clipthick]); +// cubetruss(extents, [clips=], [bracing=], [size=], [strut=], [clipthick=], ...) [ATTACHMENTS]; // Description: // Creates a cubetruss truss, assembled out of one or more cubical segments. // Arguments: // extents = The number of cubes in length to make the truss. If given as a [X,Y,Z] vector, specifies the number of cubes in each dimension. // clips = List of vectors pointing towards the sides to add clips to. +// bracing = If true, adds internal cross-braces. Default: `$cubetruss_bracing` (usually true) // size = The length of each side of the cubetruss cubes. Default: `$cubetruss_size` (usually 30) // strut = The width of the struts on the cubetruss cubes. Default: `$cubetruss_strut_size` (usually 3) -// bracing = If true, adds internal cross-braces. Default: `$cubetruss_bracing` (usually true) // clipthick = The thickness of the clips. Default: `$cubetruss_clip_thickness` (usually 1.6) // --- // anchor = Translate so anchor point is at origin (0,0,0). See [anchor](attachments.scad#subsection-anchor). Default: `CENTER` @@ -94,15 +94,15 @@ module cubetruss(extents=6, clips=[], bracing, size, strut, clipthick, anchor=CE // Topics: Trusses, CubeTruss, FDM Optimized, Parts // See Also: cubetruss_segment(), cubetruss_support(), cubetruss(), cubetruss_corner() // Usage: -// cubetruss_corner(h, extents, [bracing], [size], [strut], [clipthick]); +// cubetruss_corner(h, extents, [bracing=], [size=], [strut=], [clipthick=]); // Description: // Creates a corner cubetruss with extents jutting out in one or more directions. // Arguments: // h = The number of cubes high to make the base and horizontal extents. // extents = The number of cubes to extend beyond the corner. If given as a vector of cube counts, gives the number of cubes to extend right, back, left, front, and up in order. If the vector is shorter than length 5 the extra cube counts are taken to be zero. +// bracing = If true, adds internal cross-braces. Default: `$cubetruss_bracing` (usually true) // size = The length of each side of the cubetruss cubes. Default: `$cubetruss_size` (usually 30) // strut = The width of the struts on the cubetruss cubes. Default: `$cubetruss_strut_size` (usually 3) -// bracing = If true, adds internal cross-braces. Default: `$cubetruss_bracing` (usually true) // clipthick = The thickness of the clips. Default: `$cubetruss_clip_thickness` (usually 1.6) // --- // anchor = Translate so anchor point is at origin (0,0,0). See [anchor](attachments.scad#subsection-anchor). Default: `CENTER` @@ -170,7 +170,7 @@ module cubetruss_corner(h=1, extents=[1,1,0,0,1], bracing, size, strut, clipthic // Topics: Trusses, CubeTruss, FDM Optimized, Parts // See Also: cubetruss_segment(), cubetruss_support(), cubetruss(), cubetruss_corner() // Usage: -// cubetruss_support([size], [strut], [extents], [anchor], [spin], [orient]) [ATTACHMENTS]; +// cubetruss_support([size=], [strut=], [extents=]) [ATTACHMENTS]; // Description: // Creates a single cubetruss support. // Arguments: @@ -237,7 +237,7 @@ module cubetruss_support(size, strut, extents=1, anchor=CENTER, spin=0, orient=U // Topics: Trusses, CubeTruss, FDM Optimized, Parts // See Also: cubetruss_segment(), cubetruss_support(), cubetruss(), cubetruss_corner() // Usage: -// cubetruss_foot(w, [size], [strut], [clipthick], [$slop=], [anchor=], [spin=], [orient=]) [ATTACHMENTS]; +// cubetruss_foot(w, [size=], [strut=], [clipthick=]) [ATTACHMENTS]; // Description: // Creates a foot that can be clipped onto the bottom of a truss for support. // Arguments: @@ -317,7 +317,7 @@ module cubetruss_foot(w=1, size, strut, clipthick, anchor=CENTER, spin=0, orient // Topics: Trusses, CubeTruss, FDM Optimized, Parts // See Also: cubetruss_segment(), cubetruss_support(), cubetruss(), cubetruss_corner() // Usage: -// cubetruss_joiner([w], [vert], [size], [strut], [clipthick], [$slop=], [anchor=], [spin=], [orient=]) [ATTACHMENTS]; +// cubetruss_joiner([w=], [vert=], [size=], [strut=], [clipthick=]) [ATTACHMENTS]; // Description: // Creates a part to join two cubetruss trusses end-to-end. // Arguments: @@ -388,7 +388,7 @@ module cubetruss_joiner(w=1, vert=true, size, strut, clipthick, anchor=CENTER, s // Topics: Trusses, CubeTruss, FDM Optimized, Parts // See Also: cubetruss_segment(), cubetruss_support(), cubetruss(), cubetruss_corner() // Usage: -// cubetruss_uclip(dual, [size], [strut], [clipthick], [$slop=], [anchor=], [spin=], [orient=]) [ATTACHMENTS]; +// cubetruss_uclip(dual, [size=], [strut=], [clipthick=]) [ATTACHMENTS]; // Description: // Creates a small clip that can snap around one or two adjacent struts. // Arguments: @@ -440,7 +440,7 @@ module cubetruss_uclip(dual=true, size, strut, clipthick, anchor=CENTER, spin=0, // Topics: Trusses, CubeTruss, FDM Optimized, Parts // See Also: cubetruss_segment(), cubetruss_support(), cubetruss(), cubetruss_corner() // Usage: -// cubetruss_segment([size], [strut], [bracing]); +// cubetruss_segment([size=], [strut=], [bracing=]); // Description: // Creates a single cubetruss cube segment. // Arguments: @@ -512,7 +512,7 @@ module cubetruss_segment(size, strut, bracing, anchor=CENTER, spin=0, orient=UP) // Topics: Trusses, CubeTruss, FDM Optimized, Parts // See Also: cubetruss_segment(), cubetruss_support(), cubetruss(), cubetruss_corner() // Usage: -// cubetruss_clip(extents, [size], [strut], [clipthick], [$slop=], [anchor=], [spin=], [orient=]) [ATTACHMENTS]; +// cubetruss_clip(extents, [size=], [strut=], [clipthick=]) [ATTACHMENTS]; // Description: // Creates a pair of clips to add onto the end of a truss. // Arguments: @@ -580,7 +580,7 @@ module cubetruss_clip(extents=1, size, strut, clipthick, anchor=CENTER, spin=0, // Topics: Trusses, CubeTruss, FDM Optimized, Parts // See Also: cubetruss_segment(), cubetruss_support(), cubetruss(), cubetruss_corner() // Usage: -// cubetruss_dist(cubes, gaps, [size], [strut]); +// length = cubetruss_dist(cubes, [gaps], [size=], [strut=]); // Description: // Function to calculate the length of a cubetruss truss. // Arguments: diff --git a/gears.scad b/gears.scad index 7eab166..6461cd6 100644 --- a/gears.scad +++ b/gears.scad @@ -33,8 +33,8 @@ // spur_gear(pitch, teeth, thickness, [shaft_diam], [hide=], [pressure_angle=], [clearance=], [backlash=], [helical=], [slices=], [interior=]) [ATTACHMENTS]; // spur_gear(mod=, teeth=, thickness=, [shaft_diam=], ...) [ATTACHMENTS]; // Usage: As a Function -// vnf = spur_gear(pitch, teeth, thickness, [shaft_diam], ...); -// vnf = spur_gear(mod=, teeth=, thickness=, [shaft_diam], ...); +// vnf = spur_gear(pitch, teeth, thickness, [shaft_diam=], ...); +// vnf = spur_gear(mod=, teeth=, thickness=, [shaft_diam=], ...); // Description: // Creates a (potentially helical) involute spur gear. The module `spur_gear()` gives an involute // spur gear, with reasonable defaults for all the parameters. Normally, you should just choose the @@ -297,11 +297,11 @@ module spur_gear2d( // Topics: Gears, Parts // See Also: rack2d(), spur_gear(), spur_gear2d(), bevel_gear() // Usage: As a Module -// rack(pitch, teeth, thickness, height, [pressure_angle=], [backlash=]) [ATTACHMENTS]; -// rack(mod=, teeth=, thickness=, height=, [pressure_angle=], [backlash]=) [ATTACHMENTS]; +// rack(pitch, teeth, thickness, height, [pressure_angle=], [backlash=], [clearance=], [helical=]) [ATTACHMENTS]; +// rack(mod=, teeth=, thickness=, height=, [pressure_angle=], [backlash]=, [clearance=], [helical=]) [ATTACHMENTS]; // Usage: As a Function -// vnf = rack(pitch, teeth, thickness, height, [pressure_angle=], [backlash=]); -// vnf = rack(mod=, teeth=, thickness=, height=, [pressure_angle=], [backlash=]); +// vnf = rack(pitch, teeth, thickness, height, [pressure_angle=], [backlash=], [clearance=], [helical=]); +// vnf = rack(mod=, teeth=, thickness=, height=, [pressure_angle=], [backlash=], [clearance=], [helical=]); // Description: // This is used to create a 3D rack, which is a linear bar with teeth that a gear can roll along. // A rack can mesh with any gear that has the same `pitch` and `pressure_angle`. @@ -446,11 +446,11 @@ function rack( // Topics: Gears, Parts // See Also: rack(), spur_gear(), spur_gear2d(), bevel_gear() // Usage: As a Module -// path = rack2d(pitch, teeth, height, [pressure_angle=], [backlash=]) [ATTACHMENTS]; -// path = rack2d(mod=, teeth=, height=, [pressure_angle=], [backlash=]) [ATTACHMENTS]; +// rack2d(pitch, teeth, height, [pressure_angle=], [backlash=], [clearance=]) [ATTACHMENTS]; +// rack2d(mod=, teeth=, height=, [pressure_angle=], [backlash=], [clearance=]) [ATTACHMENTS]; // Usage: As a Function -// path = rack2d(pitch, teeth, height, [pressure_angle=], [backlash=]); -// path = rack2d(mod=, teeth=, height=, [pressure_angle=], [backlash=]); +// path = rack2d(pitch, teeth, height, [pressure_angle=], [backlash=], [clearance=]); +// path = rack2d(mod=, teeth=, height=, [pressure_angle=], [backlash=], [clearance=]); // Description: // This is used to create a 2D rack, which is a linear bar with teeth that a gear can roll along. // A rack can mesh with any gear that has the same `pitch` and `pressure_angle`. @@ -569,9 +569,11 @@ module rack2d( // Topics: Gears, Parts // See Also: rack(), rack2d(), spur_gear(), spur_gear2d(), bevel_pitch_angle(), bevel_gear() // Usage: As a Module -// bevel_gear(pitch|mod, teeth, face_width, pitch_angle, [shaft_diam], [hide], [pressure_angle], [clearance], [backlash], [cutter_radius], [spiral_angle], [slices], [interior]); +// bevel_gear(pitch, teeth, face_width, [pitch_angle=]|[mate_teeth=], [shaft_diam=], [hide=], [pressure_angle=], [clearance=], [backlash=], [cutter_radius=], [spiral_angle=], [left_handed=], [slices=], [interior=]); +// bevel_gear(mod=, teeth=, face_width=, [pitch_angle=]|[mate_teeth=], [shaft_diam=], [hide=], [pressure_angle=], [clearance=], [backlash=], [cutter_radius=], [spiral_angle=], [left_handed=], [slices=], [interior=]); // Usage: As a Function -// vnf = bevel_gear(pitch|mod, teeth, face_width, pitch_angle, [hide], [pressure_angle], [clearance], [backlash], [cutter_radius], [spiral_angle], [slices], [interior]); +// vnf = bevel_gear(pitch, teeth, face_width, [pitch_angle=]|[mate_teeth=], [hide=], [pressure_angle=], [clearance=], [backlash=], [cutter_radius=], [spiral_angle=], [left_handed=], [slices=], [interior=]); +// vnf = bevel_gear(mod=, teeth=, face_width=, [pitch_angle=]|[mate_teeth=], [hide=], [pressure_angle=], [clearance=], [backlash=], [cutter_radius=], [spiral_angle=], [left_handed=], [slices=], [interior=]); // Description: // Creates a (potentially spiral) bevel gear. The module `bevel_gear()` gives a bevel gear, with // reasonable defaults for all the parameters. Normally, you should just choose the first 4 @@ -599,6 +601,7 @@ module rack2d( // face_width = Width of the toothed surface in mm, from inside to outside. Default: 10 // pitch_angle = Angle of beveled gear face. Default: 45 // mate_teeth = The number of teeth in the gear that this gear will mate with. Overrides `pitch_angle` if given. +// --- // shaft_diam = Diameter of the hole in the center, in mm. Module use only. Default: 0 (no shaft hole) // hide = Number of teeth to delete to make this only a fraction of a circle. Default: 0 // pressure_angle = Controls how straight or bulged the tooth sides are. In degrees. Default: 28 @@ -826,9 +829,11 @@ module bevel_gear( // Topics: Gears, Parts // See Also: worm(), worm_gear(), rack(), rack2d(), spur_gear(), spur_gear2d(), bevel_pitch_angle(), bevel_gear() // Usage: As a Module -// worm(pitch|mod, d, l, [starts], [left_handed], [pressure_angle], [backlash], [clearance]); +// worm(pitch, d, l, [starts=], [left_handed=], [pressure_angle=], [backlash=], [clearance=]); +// worm(mod=, d=, l=, [starts=], [left_handed=], [pressure_angle=], [backlash=], [clearance=]); // Usage: As a Function -// vnf = worm(pitch|mod, d, l, [starts], [left_handed], [pressure_angle], [backlash], [clearance]); +// vnf = worm(pitch, d, l, [starts=], [left_handed=], [pressure_angle=], [backlash=], [clearance=]); +// vnf = worm(mod=, d=, l=, [starts=], [left_handed=], [pressure_angle=], [backlash=], [clearance=]); // Description: // Creates a worm shape that can be matched to a worm gear. // Arguments: @@ -944,9 +949,11 @@ module worm( // Topics: Gears, Parts // See Also: worm(), worm_gear(), rack(), rack2d(), spur_gear(), spur_gear2d(), bevel_pitch_angle(), bevel_gear() // Usage: As a Module -// worm_gear(pitch|mod, teeth, worm_diam, [worm_starts], [crowning], [left_handed], [pressure_angle], [backlash], [slices], [clearance], [shaft_diam]); +// worm_gear(pitch, teeth, worm_diam, [worm_starts=], [worm_arc=], [crowning=], [left_handed=], [pressure_angle=], [backlash=], [clearance=], [slices=], [shaft_diam=]) [ATTACHMENTS]; +// worm_gear(mod=, teeth=, worm_diam=, [worm_starts=], [worm_arc=], [crowning=], [left_handed=], [pressure_angle=], [backlash=], [clearance=], [slices=], [shaft_diam=]) [ATTACHMENTS]; // Usage: As a Function -// vnf = worm_gear(pitch|mod, teeth, worm_diam, [worm_starts], [crowning], [left_handed], [pressure_angle], [backlash], [slices], [clearance]); +// vnf = worm_gear(pitch, teeth, worm_diam, [worm_starts=], [worm_arc=], [crowning=], [left_handed=], [pressure_angle=], [backlash=], [clearance=], [slices=]); +// vnf = worm_gear(mod=, teeth=, worm_diam=, [worm_starts=], [worm_arc=], [crowning=], [left_handed=], [pressure_angle=], [backlash=], [clearance=], [slices=]); // Description: // Creates a worm gear to match with a worm. // Arguments: @@ -1007,8 +1014,8 @@ function worm_gear( pressure_angle = 20, backlash = 0, clearance, - mod, slices = 10, + mod, anchor = CENTER, spin = 0, orient = UP @@ -1238,7 +1245,8 @@ module _gear_tooth_profile( // Topics: Gears, Parts // See Also: spur_gear(), diametral_pitch(), circular_pitch(), pitch_value() // Usage: -// circp = circular_pitch(pitch|mod); +// circp = circular_pitch(pitch); +// circp = circular_pitch(mod=); // Description: // Get tooth density expressed as "circular pitch". // Arguments: @@ -1257,7 +1265,8 @@ function circular_pitch(pitch=5, mod) = // Topics: Gears, Parts // See Also: spur_gear(), diametral_pitch(), circular_pitch(), pitch_value() // Usage: -// dp = diametral_pitch(pitch|mod); +// dp = diametral_pitch(pitch); +// dp = diametral_pitch(mod=); // Description: // Get tooth density expressed as "diametral pitch". // Arguments: @@ -1359,7 +1368,8 @@ function _dedendum(pitch=5, clearance, mod) = // Topics: Gears, Parts // See Also: spur_gear(), diametral_pitch(), circular_pitch(), pitch_value(), module_value(), outer_radius() // Usage: -// pr = pitch_radius(pitch|mod, teeth); +// pr = pitch_radius(pitch, teeth); +// pr = pitch_radius(mod=, teeth=); // Description: // Calculates the pitch radius for the gear. Two mated gears will have their centers spaced apart // by the sum of the two gear's pitch radii. @@ -1385,7 +1395,8 @@ function pitch_radius(pitch=5, teeth=11, mod) = // Topics: Gears, Parts // See Also: spur_gear(), diametral_pitch(), circular_pitch(), pitch_value(), module_value(), pitch_radius(), outer_radius() // Usage: -// or = outer_radius(pitch|mod, teeth, [clearance], [interior]); +// or = outer_radius(pitch, teeth, [clearance=], [interior=]); +// or = outer_radius(mod=, teeth=, [clearance=], [interior=]); // Description: // Calculates the outer radius for the gear. The gear fits entirely within a cylinder of this radius. // Arguments: @@ -1463,7 +1474,7 @@ function _base_radius(pitch=5, teeth=11, pressure_angle=28, mod) = // Topics: Gears, Parts // See Also: bevel_gear(), pitch_radius(), outer_radius() // Usage: -// ang = bevel_pitch_angle(teeth, mate_teeth, [drive_angle]); +// ang = bevel_pitch_angle(teeth, mate_teeth, [drive_angle=]); // Description: // Returns the correct pitch cone angle for a bevel gear with a given number of teeth, that is // matched to another bevel gear with a (possibly different) number of teeth. @@ -1495,7 +1506,8 @@ function bevel_pitch_angle(teeth, mate_teeth, drive_angle=90) = // Topics: Gears, Parts // See Also: worm(), worm_gear(), pitch_radius(), outer_radius() // Usage: -// thick = worm_gear_thickness(pitch|mod, teeth, worm_diam, [worm_arc], [crowning], [clearance]); +// thick = worm_gear_thickness(pitch, teeth, worm_diam, [worm_arc=], [crowning=], [clearance=]); +// thick = worm_gear_thickness(mod=, teeth=, worm_diam=, [worm_arc=], [crowning=], [clearance=]); // Description: // Calculate the thickness of the worm gear. // Arguments: