Merge pull request #1532 from xloem/gears

propagate fix for negative helix angles
This commit is contained in:
adrianVmariano 2024-12-24 09:49:58 -05:00 committed by GitHub
commit 93752014b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -932,7 +932,7 @@ function spur_gear(
: assert(false,"atype must be one of \"root\", \"tip\" or \"pitch\""),
circum = 2 * PI * pr,
twist = 360*thickness*tan(helical)/circum,
slices = default(slices, ceil(twist/360*segs(pr)+1)),
slices = default(slices, ceil(abs(twist)/360*segs(pr)+1)),
rgn = spur_gear2d(
circ_pitch = circ_pitch,
teeth = teeth,
@ -1437,7 +1437,7 @@ module ring_gear(
: 2*ar - rr; // default case
circum = 2 * PI * pr;
twist = 360*thickness*tan(-helical)/circum;
slices = default(slices, ceil(twist/360*segs(pr)+1));
slices = default(slices, ceil(abs(twist)/360*segs(pr)+1));
attachable(anchor,spin,orient, h=thickness, r=atype=="outside"?or:pr) {
zrot(gear_spin)
if (herringbone) {