Merge pull request #1441 from adrianVmariano/master

spiral sweep bugfix
This commit is contained in:
Revar Desmera 2024-06-12 22:57:08 -07:00 committed by GitHub
commit 76d09271c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View file

@ -116,7 +116,8 @@ module square(size=1, center, anchor, spin) {
// Example(2D): Negative-Rounded Rect
// rect([40,30], rounding=-5);
// Example(2D): Combined Rounded-Chamfered Rect with corner flips
// rect(chamfer = 0.25*[0,1,-1,0], rounding=.25*[1,0,0,-1], corner_flip = true);
// rect([1,1], chamfer = 0.25*[0,1,-1,0],
// rounding=.25*[1,0,0,-1], corner_flip = true, $fn=32);
// Example(2D): Default "box" Anchors
// color("red") rect([40,30]);
// rect([40,30], rounding=10)

View file

@ -1237,7 +1237,7 @@ function spiral_sweep(poly, h, r, turns=1, taper, r1, r2, d, d1, d2, internal=fa
ang_step = 360/sides,
turns = abs(turns),
lead_in1 = first_defined([lead_in1, lead_in]),
lead_in2 = first_defined([lead_in1, lead_in]),
lead_in2 = first_defined([lead_in2, lead_in]),
lead_in_ang1 =
let(
user_ang = first_defined([lead_in_ang1,lead_in_ang])
@ -1253,7 +1253,7 @@ function spiral_sweep(poly, h, r, turns=1, taper, r1, r2, d, d1, d2, internal=fa
minang = -max(0,lead_in_ang1),
maxang = 360*turns + max(0,lead_in_ang2),
cut_ang1 = minang+abs(lead_in_ang1),
cut_ang2 = maxang-abs(lead_in_ang1),
cut_ang2 = maxang-abs(lead_in_ang2),
lead_in_shape1 = first_defined([lead_in_shape1, lead_in_shape, "default"]),
lead_in_shape2 = first_defined([lead_in_shape2, lead_in_shape, "default"]),
lead_in_func1 = is_func(lead_in_shape1) ? lead_in_shape1