handle the case of no outlines
This commit is contained in:
parent
8cb0f37b26
commit
a58f0f7aa9
1 changed files with 8 additions and 6 deletions
|
|
@ -491,12 +491,14 @@
|
||||||
let flatLevels = depthData.map(level => {
|
let flatLevels = depthData.map(level => {
|
||||||
return POLY.flatten(level.clone(true), [], true).filter(p => !(p.depth = 0));
|
return POLY.flatten(level.clone(true), [], true).filter(p => !(p.depth = 0));
|
||||||
}).filter(l => l.length > 0);
|
}).filter(l => l.length > 0);
|
||||||
// start with the smallest polygon on the top
|
if (flatLevels.length && flatLevels[0].length) {
|
||||||
printPoint = flatLevels[0]
|
// start with the smallest polygon on the top
|
||||||
.sort((a,b) => { return a.area() - b.area() })[0]
|
printPoint = flatLevels[0]
|
||||||
.average();
|
.sort((a,b) => { return a.area() - b.area() })[0]
|
||||||
printPoint = depthOutlinePath(printPoint, 0, flatLevels, toolDiam, polyEmit, false);
|
.average();
|
||||||
printPoint = depthOutlinePath(printPoint, 0, flatLevels, toolDiam, polyEmit, true);
|
printPoint = depthOutlinePath(printPoint, 0, flatLevels, toolDiam, polyEmit, false);
|
||||||
|
printPoint = depthOutlinePath(printPoint, 0, flatLevels, toolDiam, polyEmit, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setPrintPoint(printPoint);
|
setPrintPoint(printPoint);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue