danger. major redo of core fdm slicer line connection algorithm. seems to handle non-manifold parts better. seems faster on torture tests. too good to be true?

This commit is contained in:
Stewart Allen 2022-01-23 12:43:51 -05:00
commit 86fd0e78ce
5 changed files with 75 additions and 157 deletions

View file

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

View file

@ -20,7 +20,7 @@
* @constructor
*/
function Line(p1, p2, key) {
if (!key) key = [p1.key, p2.key].join('-');
if (!key) key = [p1.key, p2.key].join(';');
this.p1 = p1;
this.p2 = p2;
this.key = key;

View file

@ -272,7 +272,7 @@
}
function flatten(polys, to, crush) {
if (!to) to = [];
to = to || [];
polys.forEach(function(poly) {
poly.flattenTo(to);
if (crush) poly.inner = null;
@ -399,7 +399,7 @@
for (j=i+1; j<out.length; j++) {
if (!out[j]) continue;
union = out[i].union(out[j], minarea, all);
if (union) {
if (union && union.length) {
out[i] = null;
out[j] = null;
if (all) {