Skip to content

Commit

Permalink
corrected helix angle
Browse files Browse the repository at this point in the history
  • Loading branch information
dpellegr committed May 20, 2021
1 parent 4abfed0 commit 42face5
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions PolyGear.scad
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,9 @@ module spur_gear(
z = is_undef(w) ? z : w;
pressure_angle = is_undef(a0) ? pressure_angle : a0;
helix_angle = let(hlx = is_undef(b0) ? helix_angle : b0)
is_list(hlx) ? hlx : [hlx/2, hlx/2];
is_list(hlx) ? hlx : [hlx, hlx];
backlash = is_undef(tol) ? backlash : tol; // in module units
fz = len(helix_angle);
// echo(helix_angle);
pts = flatten([ for (i=[0:fz-1]) let(zi= z*i/(fz-1) - z/2) gear_section(
n=n, m=m, z=zi,
pressure_angle = pressure_angle, helix_angle = helix_angle[i], backlash = backlash,
Expand Down Expand Up @@ -107,11 +106,13 @@ module bevel_gear(
H0 = r0/tan(cone_angle);
pts = flatten([ for (i=[0:fz-1]) let(zi=i*z/(fz-1), H=H0-zi, R=H/cos(cone_angle))
Tzpts (
fold_on_sphere(
gear_section(
n=n, m=m*H/H0, z=0,
pressure_angle = pressure_angle, helix_angle = helix_angle[i], backlash = backlash,
add = add, ded = ded, x = x, type = type, $fn=$fn
fold_on_sphere(
Tzpts (
gear_section(
n=n, m=m*H/H0, z=zi - z/2, // need to pass z here to properly compute the helix...
pressure_angle = pressure_angle, helix_angle = helix_angle[i], backlash = backlash,
add = add, ded = ded, x = x, type = type, $fn=$fn
), -zi + z/2 // ...even if here is subtracted
), R, [0,0,H]
), zi
)
Expand Down

0 comments on commit 42face5

Please sign in to comment.