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

@ -479,7 +479,8 @@
// default # of decimal places in generated gcode
gcode_decimals : 4,
// heal disjoint polygons in slicing (experimental)
bridgeLineGapDistance : 0.5,
bridgeLineGapDistance : 0.05,
bridgeLineGapDistanceMax : 2,
// Bounds default margin nearTo
// Polygon.offset mindist2 offset precision
precision_offset : 0.05,

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.