Renamed double_enveloping_worm() to enveloping_worm()

This commit is contained in:
Revar Desmera 2023-08-16 19:00:51 -07:00
parent dcaa0e7641
commit e9500ff7f3

View file

@ -2252,19 +2252,19 @@ module worm(
} }
// Function&Module: double_enveloping_worm() // Function&Module: enveloping_worm()
// Synopsis: Creates a double-enveloping worm that will mate with a worm gear. // Synopsis: Creates a double-enveloping worm that will mate with a worm gear.
// SynTags: Geom, VNF // SynTags: Geom, VNF
// Topics: Gears, Parts // Topics: Gears, Parts
// See Also: worm(), worm_gear(), rack(), rack2d(), spur_gear(), spur_gear2d(), bevel_pitch_angle(), bevel_gear() // See Also: worm(), worm_gear(), rack(), rack2d(), spur_gear(), spur_gear2d(), bevel_pitch_angle(), bevel_gear()
// Usage: As a Module // Usage: As a Module
// double_enveloping_worm(circ_pitch, mate_teeth, d, [left_handed=], [starts=], [arc=], [pressure_angle=]); // enveloping_worm(circ_pitch, mate_teeth, d, [left_handed=], [starts=], [arc=], [pressure_angle=]);
// double_enveloping_worm(mod=, mate_teeth=, d=, [left_handed=], [starts=], [arc=], [pressure_angle=]); // enveloping_worm(mod=, mate_teeth=, d=, [left_handed=], [starts=], [arc=], [pressure_angle=]);
// double_enveloping_worm(diam_pitch=, mate_teeth=, d=, [left_handed=], [starts=], [arc=], [pressure_angle=]); // enveloping_worm(diam_pitch=, mate_teeth=, d=, [left_handed=], [starts=], [arc=], [pressure_angle=]);
// Usage: As a Function // Usage: As a Function
// vnf = double_enveloping_worm(circ_pitch, mate_teeth, d, [left_handed=], [starts=], [arc=], [pressure_angle=]); // vnf = enveloping_worm(circ_pitch, mate_teeth, d, [left_handed=], [starts=], [arc=], [pressure_angle=]);
// vnf = double_enveloping_worm(mod=, mate_teeth=, d=, [left_handed=], [starts=], [arc=], [pressure_angle=]); // vnf = enveloping_worm(mod=, mate_teeth=, d=, [left_handed=], [starts=], [arc=], [pressure_angle=]);
// vnf = double_enveloping_worm(diam_pitch=, mate_teeth=, d=, [left_handed=], [starts=], [arc=], [pressure_angle=]); // vnf = enveloping_worm(diam_pitch=, mate_teeth=, d=, [left_handed=], [starts=], [arc=], [pressure_angle=]);
// Description: // Description:
// Creates a double-enveloping worm shape that can be matched to a worm gear. // Creates a double-enveloping worm shape that can be matched to a worm gear.
// Arguments: // Arguments:
@ -2282,16 +2282,16 @@ module worm(
// spin = Rotate this many degrees around the Z axis after anchor. See [spin](attachments.scad#subsection-spin). Default: `0` // 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` // orient = Vector to rotate top towards, after spin. See [orient](attachments.scad#subsection-orient). Default: `UP`
// Example: // Example:
// double_enveloping_worm(circ_pitch=8, mate_teeth=45, d=30, $fn=72); // enveloping_worm(circ_pitch=8, mate_teeth=45, d=30, $fn=72);
// Example: Multiple Starts. // Example: Multiple Starts.
// double_enveloping_worm(circ_pitch=8, mate_teeth=33, d=30, starts=3, $fn=72); // enveloping_worm(circ_pitch=8, mate_teeth=33, d=30, starts=3, $fn=72);
// Example: Left Handed // Example: Left Handed
// double_enveloping_worm(circ_pitch=8, mate_teeth=33, d=30, starts=3, left_handed=true, $fn=72); // enveloping_worm(circ_pitch=8, mate_teeth=33, d=30, starts=3, left_handed=true, $fn=72);
// Example: Called as Function // Example: Called as Function
// vnf = double_enveloping_worm(circ_pitch=8, mate_teeth=37, d=35, starts=2, left_handed=true, pressure_angle=20, $fn=72); // vnf = enveloping_worm(circ_pitch=8, mate_teeth=37, d=35, starts=2, left_handed=true, pressure_angle=20, $fn=72);
// vnf_polyhedron(vnf); // vnf_polyhedron(vnf);
function double_enveloping_worm( function enveloping_worm(
circ_pitch, circ_pitch,
mate_teeth, mate_teeth,
d, d,
@ -2300,10 +2300,12 @@ function double_enveloping_worm(
arc=45, arc=45,
pressure_angle=20, pressure_angle=20,
gear_spin=0, gear_spin=0,
anchor=CTR, rounding=true,
taper=true,
diam_pitch, diam_pitch,
mod, mod,
pitch, pitch,
anchor=CTR,
spin=0, spin=0,
orient=UP orient=UP
) = ) =
@ -2320,25 +2322,34 @@ function double_enveloping_worm(
vsteps = hsteps*3, vsteps = hsteps*3,
helical = asin(starts * circ_pitch / PI / d), helical = asin(starts * circ_pitch / PI / d),
pr = pitch_radius(circ_pitch, mate_teeth, helical=helical), pr = pitch_radius(circ_pitch, mate_teeth, helical=helical),
taper_table = [ taper_table = taper
[-180, 0], ? [
[-arc/2, 0], [-180, 0],
[-arc/2*0.85, 0.75], [-arc/2, 0],
[-arc/2*0.8, 0.93], [-arc/2*0.85, 0.75],
[-arc/2*0.75, 1], [-arc/2*0.8, 0.93],
[+arc/2*0.75, 1], [-arc/2*0.75, 1],
[+arc/2*0.8, 0.93], [+arc/2*0.75, 1],
[+arc/2*0.85, 0.75], [+arc/2*0.8, 0.93],
[+arc/2, 0], [+arc/2*0.85, 0.75],
[+180, 0], [+arc/2, 0],
], [+180, 0],
]
: [
[-180, 0],
[-arc/2-0.00001, 0],
[-arc/2, 1],
[+arc/2, 1],
[+arc/2+0.00001, 0],
[+180, 0],
],
tarc = 360 / mate_teeth, tarc = 360 / mate_teeth,
rteeth = quantup(ceil(mate_teeth*arc/360),2)+1+2*starts, rteeth = quantup(ceil(mate_teeth*arc/360),2)+1+2*starts,
rack_path = select( rack_path = select(
rack2d( rack2d(
circ_pitch, rteeth, circ_pitch, rteeth,
pressure_angle=pressure_angle, pressure_angle=pressure_angle,
rounding=true, spin=90 rounding=rounding, spin=90
), ),
1,-2 1,-2
), ),
@ -2378,7 +2389,7 @@ function double_enveloping_worm(
) reorient(anchor,spin,orient, d=d, l=maxy-miny, p=vnf); ) reorient(anchor,spin,orient, d=d, l=maxy-miny, p=vnf);
module double_enveloping_worm( module enveloping_worm(
circ_pitch, circ_pitch,
mate_teeth, mate_teeth,
d, d,
@ -2387,6 +2398,8 @@ module double_enveloping_worm(
arc=45, arc=45,
pressure_angle=20, pressure_angle=20,
gear_spin=0, gear_spin=0,
rounding=true,
taper=true,
diam_pitch, diam_pitch,
mod, mod,
pitch, pitch,
@ -2394,7 +2407,7 @@ module double_enveloping_worm(
spin=0, spin=0,
orient=UP orient=UP
) { ) {
vnf = double_enveloping_worm( vnf = enveloping_worm(
mate_teeth=mate_teeth, mate_teeth=mate_teeth,
d=d, d=d,
left_handed=left_handed, left_handed=left_handed,
@ -2402,6 +2415,8 @@ module double_enveloping_worm(
arc=arc, arc=arc,
pressure_angle=pressure_angle, pressure_angle=pressure_angle,
gear_spin=gear_spin, gear_spin=gear_spin,
rounding=rounding,
taper=taper,
circ_pitch=circ_pitch, circ_pitch=circ_pitch,
diam_pitch=diam_pitch, diam_pitch=diam_pitch,
mod=mod, mod=mod,
@ -2540,6 +2555,7 @@ function worm_gear(
backlash=backlash, backlash=backlash,
helical=helical, helical=helical,
profile_shift=profile_shift, profile_shift=profile_shift,
internal=true,
center=true center=true
), ),
tbot = min(column(tooth_profile,1)), tbot = min(column(tooth_profile,1)),