Tweaked uniform skin method.

This commit is contained in:
Revar Desmera 2020-02-02 19:33:09 -08:00
parent f16de52e4a
commit 28f07a997f
2 changed files with 6 additions and 4 deletions

View file

@ -262,9 +262,11 @@ function skin(profiles, closed=false, caps=true, method="uniform") =
dist2 = norm(mid2-midpt)
) (dist1<dist2? 1 : 0) :
match=="uniform"? let(
pctdist1 = abs((i/plen1) - ((j+1)/plen2)),
pctdist2 = abs((j/plen2) - ((i+1)/plen1))
) (pctdist1>pctdist2? 1 : 0) :
pct1 = i/plen1,
pct2 = j/plen2,
dist1 = norm(p1a-p2b),
dist2 = norm(p1b-p2a)
) (approx(pct1,pct2)? (dist1>dist2? 1 : 0) : (pct1<=pct2? 1 : 0)) :
assert(in_list(match,["distance","angle","convex","uniform"]),str("Got `",method,"'")),
p1 = voff + (i%plen1),
p2 = voff + (j%plen2) + plen1,

View file

@ -8,7 +8,7 @@
//////////////////////////////////////////////////////////////////////
BOSL_VERSION = [2,0,115];
BOSL_VERSION = [2,0,116];
// Section: BOSL Library Version Functions