Skip to content

Commit dbb20fa

Browse files
special case teardrop $fn=6
1 parent 93230f2 commit dbb20fa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

shapes2d.scad

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,15 +1251,17 @@ function teardrop2d(r, ang=45, cap_h, d, circum=false, realign=false, anchor=CEN
12511251
fullcircle = ellipse(r=r, realign=realign, circum=circum,spin=90),
12521252

12531253
// Chose the point on the circle that is lower than the cap but also creates a segment bigger than
1254-
// seglen/3 so we don't have a teeny tiny segment at the end of the cap
1254+
// seglen/skipfactor so we don't have a teeny tiny segment at the end of the cap, except for the hexagoin
1255+
// case which is treated specially
1256+
skipfactor = len(fullcircle)==6 ? 15 : 3,
12551257
path = !circum ?
12561258
let(seglen = norm(fullcircle[0]-fullcircle[1]))
12571259
[
12581260
each cap,
12591261
for (p=fullcircle)
12601262
if (
12611263
p.y<last(cap).y-EPSILON
1262-
&& norm([abs(p.x)-last(cap).x,p.y-last(cap.y)])>seglen/3
1264+
&& norm([abs(p.x)-last(cap).x,p.y-last(cap.y)])>seglen/skipfactor
12631265
) p,
12641266
xflip(cap[1]),
12651267
if (_extrapt || !pointycap) xflip(cap[0])

0 commit comments

Comments
 (0)