got an angle reversed. tweaked deburring for path renders

This commit is contained in:
Stewart Allen 2020-11-11 18:19:57 -05:00
commit 7264b9f7ca
2 changed files with 4 additions and 4 deletions

View file

@ -271,7 +271,7 @@
const aln = open ? pln - 1 : pln; const aln = open ? pln - 1 : pln;
for (let i=1; i<aln; i++) { for (let i=1; i<aln; i++) {
ang[i] = slopeDiff(slo[i-1], slo[i]); ang[i] = slopeDiff(slo[i-1], slo[i]);
redo |= ang[i] < 90; redo |= ang[i] > 90;
} }
if (!open) { if (!open) {
// ang[pln-1] = slopeDiff(slo[pln-2], slo[pln-1]); // ang[pln-1] = slopeDiff(slo[pln-2], slo[pln-1]);
@ -290,8 +290,8 @@
const s = slo[(i+pln) % pln]; const s = slo[(i+pln) % pln];
const pp = pa[(i+pln-1) % pln]; const pp = pa[(i+pln-1) % pln];
const ps = slo[(i+pln-1) % pln]; const ps = slo[(i+pln-1) % pln];
newp.push(p.follow(p.slopeTo(pp), 0.005)); newp.push(p.follow(p.slopeTo(pp), 0.001));
newp.push(p.follow(s, 0.005)); newp.push(p.follow(s, 0.001));
} else { } else {
p.parent = newp; p.parent = newp;
newp.push(p); newp.push(p);

View file

@ -164,7 +164,7 @@
polys.forEach(poly => { polys.forEach(poly => {
const contour = []; const contour = [];
poly = poly.debur(); poly = poly.debur(0.05);
if (!poly) return; if (!poly) return;
poly = poly.miter(); poly = poly.miter();
// cleaning converts open to closed which is problematic // cleaning converts open to closed which is problematic