diff --git a/src/kiri/mode/cam/op-area.js b/src/kiri/mode/cam/op-area.js index 20b7df99..e02d81d7 100644 --- a/src/kiri/mode/cam/op-area.js +++ b/src/kiri/mode/cam/op-area.js @@ -37,8 +37,8 @@ class OpArea extends CamOp { let smoothVal = (smooth ?? 0) / 10; let toolDiam = areaTool.fluteDiameter(); let toolOver = areaTool.getStepSize(over); - let zTop = ov_topz ? workarea.bottom_stock + ov_topz : workarea.top_z; - let zBottom = ov_botz ? workarea.bottom_stock + ov_botz : Math.max(workarea.bottom_z, workarea.bottom_part) + workarea.bottom_cut; + let zTop = workarea.top_z; + let zBottom = Math.max(workarea.bottom_z, workarea.bottom_part) + workarea.bottom_cut; let shadowBase = state.shadow.base; let thruHoles = state.shadow.holes; @@ -181,7 +181,7 @@ class OpArea extends CamOp { outs = omitInner(outs); } // add tabs to travel boundaries - if (tabs) { + if (tabs.length) { let tab_shadows = tabs.filter(t => t.top >= z).map(t => t.poly); if (tab_shadows) tool_shadow.push(...tab_shadows); } @@ -244,7 +244,7 @@ class OpArea extends CamOp { // add dogbones when specified if (op.dogbones) outs.forEach(out => out.addDogbones(toolDiam / 5, op.revbones)); // cut tabs when present - if (tabs) outs = cutTabs(tabs, outs); + if (tabs.length) outs = cutTabs(tabs, outs); // support legacy outline features if (op.omitouter) { outs = omitOuter(outs); diff --git a/src/kiri/mode/cam/slice.js b/src/kiri/mode/cam/slice.js index efae5041..5a181643 100644 --- a/src/kiri/mode/cam/slice.js +++ b/src/kiri/mode/cam/slice.js @@ -21,7 +21,28 @@ import { util } from '../../../geo/base.js'; export async function cam_slice(settings, widget, onupdate, ondone) { if (widget.track.synth) return ondone(); + // get tab widgets let tabW = widget.group.filter(w => w != widget); + // merge overlapping tabs + for (let i=0; i !tw.del); let proc = settings.process, camOps = widget.camops = [], @@ -41,7 +62,7 @@ export async function cam_slice(settings, widget, onupdate, ondone) { color = dark ? 0xbbbbbb : 0; minToolDiam = Infinity; maxToolDiam = -Infinity; - tabs = widget.anno.tab; + tabs = widget.anno.tab ?? []; unsafe = proc.camExpertFast; units = settings.controller.units === 'in' ? 25.4 : 1;