improve performance of pocketed roughing by simplifying pancaked shell

This commit is contained in:
Stewart Allen 2020-05-04 23:00:39 -04:00
commit 051c5d6f7a
5 changed files with 19 additions and 6 deletions

View file

@ -1028,12 +1028,17 @@ var gs_base_polygon = exports;
* simplify and merge collinear. only works for single
* non-nested polygons. used primarily in slicer/connectLines.
*/
PRO.clean = function() {
var clib = self.ClipperLib,
PRO.clean = function(deep, parent) {
let clib = self.ClipperLib,
clip = clib.Clipper,
clean = clip.CleanPolygon(this.toClipper()[0], CONF.clipperClean),
poly = fromClipperPath(clean, this.getZ());
return poly;
if (deep && this.inner) {
poly.inner = this.inner.map(inr => inr.clean(false, poly));
}
poly.parent = parent || this.parent;
poly.area2 = this.area2;
return poly || this;
};
PRO.toClipper = function(inout,debug) {