fix tip2tip emit using wrong last point for open polys
This commit is contained in:
parent
25a3be2cdc
commit
2b8734d27c
2 changed files with 17 additions and 6 deletions
|
|
@ -1342,6 +1342,7 @@ let gs_kiri_cam = exports;
|
||||||
}, false);
|
}, false);
|
||||||
});
|
});
|
||||||
newLayer();
|
newLayer();
|
||||||
|
return lastPoint;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|
@ -1411,6 +1412,7 @@ let gs_kiri_cam = exports;
|
||||||
camOut(point.clone(), pidx > 0);
|
camOut(point.clone(), pidx > 0);
|
||||||
}, false);
|
}, false);
|
||||||
newLayer();
|
newLayer();
|
||||||
|
return lastPoint;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
setTool(process.finishingTool, process.finishingSpeed, process.finishingPlunge);
|
setTool(process.finishingTool, process.finishingSpeed, process.finishingPlunge);
|
||||||
|
|
@ -1424,6 +1426,7 @@ let gs_kiri_cam = exports;
|
||||||
camOut(point.clone(), pidx > 0);
|
camOut(point.clone(), pidx > 0);
|
||||||
}, false);
|
}, false);
|
||||||
newLayer();
|
newLayer();
|
||||||
|
return lastPoint;
|
||||||
});
|
});
|
||||||
// deferred linear y finishing
|
// deferred linear y finishing
|
||||||
if (depthData.lineary.length > 0)
|
if (depthData.lineary.length > 0)
|
||||||
|
|
@ -1434,6 +1437,7 @@ let gs_kiri_cam = exports;
|
||||||
camOut(point.clone(), pidx > 0);
|
camOut(point.clone(), pidx > 0);
|
||||||
}, false);
|
}, false);
|
||||||
newLayer();
|
newLayer();
|
||||||
|
return lastPoint;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -613,7 +613,9 @@ var gs_kiri_print = exports;
|
||||||
var lp = startPoint;
|
var lp = startPoint;
|
||||||
startPoint = tip2tipEmit(proxy, startPoint, function(el, point, count) {
|
startPoint = tip2tipEmit(proxy, startPoint, function(el, point, count) {
|
||||||
var poly = el.poly;
|
var poly = el.poly;
|
||||||
if (poly.last() === point) poly.reverse();
|
if (poly.last() === point) {
|
||||||
|
poly.reverse();
|
||||||
|
}
|
||||||
poly.forEachPoint(function(p, i) {
|
poly.forEachPoint(function(p, i) {
|
||||||
// retract if dist trigger and crosses a slice top polygon
|
// retract if dist trigger and crosses a slice top polygon
|
||||||
if (i === 0 && lp && lp.distTo2D(p) > retractDist && intersectsTop(lp,p)) {
|
if (i === 0 && lp && lp.distTo2D(p) > retractDist && intersectsTop(lp,p)) {
|
||||||
|
|
@ -622,6 +624,7 @@ var gs_kiri_print = exports;
|
||||||
addOutput(preout, p, i === 0 ? 0 : extrude, speed || printSpeed);
|
addOutput(preout, p, i === 0 ? 0 : extrude, speed || printSpeed);
|
||||||
lp = p;
|
lp = p;
|
||||||
});
|
});
|
||||||
|
return lp;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -871,7 +874,7 @@ var gs_kiri_print = exports;
|
||||||
if (found) {
|
if (found) {
|
||||||
found.el.delete = true;
|
found.el.delete = true;
|
||||||
startPoint = found.last;
|
startPoint = found.last;
|
||||||
emitter(found.el, found.first, ++count);
|
startPoint = emitter(found.el, found.first, ++count);
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -892,13 +895,17 @@ var gs_kiri_print = exports;
|
||||||
found = null;
|
found = null;
|
||||||
mindist = Infinity;
|
mindist = Infinity;
|
||||||
array.forEach(function(poly) {
|
array.forEach(function(poly) {
|
||||||
if (poly[marker]) return;
|
if (poly[marker]) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (poly.isOpen()) {
|
if (poly.isOpen()) {
|
||||||
const d2f = startPoint.distTo2D(poly.first());
|
const d2f = startPoint.distTo2D(poly.first());
|
||||||
const d2l = startPoint.distTo2D(poly.first());
|
const d2l = startPoint.distTo2D(poly.last());
|
||||||
if (d2f > mindist && d2l > mindist) return;
|
if (d2f > mindist && d2l > mindist) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (d2l < mindist && d2l < d2f) {
|
if (d2l < mindist && d2l < d2f) {
|
||||||
// poly.reverse();
|
poly.reverse();
|
||||||
found = {poly:poly, index:0, point:poly.first()};
|
found = {poly:poly, index:0, point:poly.first()};
|
||||||
} else if (d2f < mindist) {
|
} else if (d2f < mindist) {
|
||||||
found = {poly:poly, index:0, point:poly.first()};
|
found = {poly:poly, index:0, point:poly.first()};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue