bless a poly simple algo

This commit is contained in:
Stewart Allen 2021-06-25 10:28:39 -04:00
commit 5ef402b72d
2 changed files with 9 additions and 1 deletions

View file

@ -1428,6 +1428,13 @@
return poly; return poly;
}; };
/**
* shortcut to de-rez poly
*/
PRO.simple = function() {
return this.clean(true, undefined, Math.min(CONF.clipper / 10, CONF.clipperClean * 5));
};
/** /**
* simplify and merge collinear. only works for single * simplify and merge collinear. only works for single
* non-nested polygons. used primarily in slicer/connectLines. * non-nested polygons. used primarily in slicer/connectLines.

View file

@ -94,7 +94,8 @@
} }
// add simple (low rez poly) where less accuracy is OK // add simple (low rez poly) where less accuracy is OK
for (let top of nutops) { for (let top of nutops) {
top.simple = top.poly.clean(true, undefined, CONF.clipper / 10); // top.simple = top.poly.clean(true, undefined, CONF.clipper / 10);
top.simple = top.poly.simple();
} }
data.tops = nutops; data.tops = nutops;
}; };