Minor code cleanup in gears.scad

This commit is contained in:
Revar Desmera 2023-07-31 03:10:41 -07:00
parent fdb5355b30
commit 8c8912ae29

View File

@ -2273,6 +2273,8 @@ function _gear_tooth_profile(
steps = 16,
circ_pitch = circular_pitch(pitch=pitch, circ_pitch=circ_pitch, diam_pitch=diam_pitch, mod=mod),
mod = module_value(circ_pitch=circ_pitch),
clear = default(clearance, 0.25 * mod),
// Calculate the important circle radii
arad = outer_radius(circ_pitch, teeth, helical=helical, profile_shift=profile_shift, internal=internal),
@ -2280,11 +2282,6 @@ function _gear_tooth_profile(
brad = _base_radius(circ_pitch, teeth, pressure_angle, helical=helical),
rrad = _root_radius(circ_pitch, teeth, clearance, helical=helical, profile_shift=profile_shift, internal=internal),
adendum = _adendum(circ_pitch=circ_pitch, profile_shift=profile_shift),
dedendum = _dedendum(circ_pitch=circ_pitch, clearance=clearance, profile_shift=profile_shift),
mod = module_value(circ_pitch=circ_pitch),
clear = default(clearance, 0.25 * mod),
srad = max(rrad,brad),
tthick = circ_pitch/PI / cos(helical) * (PI/2 + 2*profile_shift * tan(pressure_angle)) - backlash,
tang = tthick / prad / 2 * 180 / PI,