allow outside only outlines to omit thru inner holes - fixes #103

This commit is contained in:
Stewart Allen 2020-12-28 08:43:55 -05:00
commit cdb0051ebd
4 changed files with 18 additions and 1 deletions

View file

@ -375,7 +375,7 @@
slice(progress) {
let { op, state } = this;
let { settings, widget, slicer, sliceAll, tshadow } = state;
let { settings, widget, slicer, sliceAll, tshadow, thruHoles } = state;
let { updateToolDiams, zThru, zBottom, shadowTop, tabs, cutTabs } = state;
let toolDiam = this.toolDiam = new CAM.Tool(settings, op.tool).fluteDiameter();
@ -441,6 +441,18 @@
tops = tshadow;
}
if (op.omitthru) {
// eliminate thru holes from shadow
for (let hole of thruHoles) {
for (let top of tops) {
if (!top.inner) continue;
top.inner = top.inner.filter(innr => {
return !innr.isEquivalent(hole);
});
}
}
}
let offset = POLY.expand(tops, toolDiam / 2, slice.z);
if (!(offset && offset.length)) {
return;