fix redundant path output in depth-first mode

This commit is contained in:
Stewart Allen 2021-01-17 22:23:51 -05:00
commit 26c0a5cf69
7 changed files with 19 additions and 12 deletions

View file

@ -365,9 +365,14 @@
if (depthFirst) {
let tops = depthData.map(level => {
// return POLY.nest(level.filter(poly => poly.depth === 0));
return POLY.nest(level.filter(poly => poly.depth === 0).clone());
});
printPoint = depthRoughPath(printPoint, 0, depthData, tops, polyEmit);
// printPoint = depthRoughPath(printPoint, 0, depthData, tops, (poly, index, count, start) => {
// console.log({z: poly.getZ(), i: poly.id, index, poly});
// return polyEmit(poly, index, count, start);
// });
}
setPrintPoint(printPoint);

View file

@ -424,7 +424,7 @@
fitted.filter(top => !top.level_emit).forEach(top => {
top.level_emit = true;
let inside = level.filter(poly => poly.isInside(top));
start = poly2polyEmit(inside, start, emitter, { mark: "emark" });
start = poly2polyEmit(inside, start, emitter, { mark: "emark", perm: true });
start = depthRoughPath(start, depth + 1, levels, tops, emitter, top);
});
return start;