checkpoint

This commit is contained in:
Stewart Allen 2022-01-25 21:54:07 -05:00
commit ab8a86b2a8
4 changed files with 145 additions and 67 deletions

View file

@ -1411,6 +1411,18 @@
return this.clean(true, undefined, Math.min(CONF.clipper / 10, CONF.clipperClean * 5));
};
// does not work with nested polys
PRO.simplify = function(parent) {
if (this.length === 0 || this.open) return [ this ];
let clib = self.ClipperLib,
clip = clib.Clipper,
ctyp = clib.ClipType,
p2cl = this.toClipper(),
clean = clip.SimplifyPolygon(p2cl[0], ctyp.pftPositive),
z = this.getZ();
return clean.map(array => fromClipperPath(array, z));
};
/**
* simplify and merge collinear. only works for single
* non-nested polygons. used primarily in slicer/connectLines.