From 65c2978f43f092d5199a14bb82e4abac2080199c Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Sun, 21 Sep 2025 17:35:44 -0400 Subject: [PATCH] fixes #421 by removing all non-extended-thru cuts when step down is greater than full cut depth of part --- src/kiri/mode/cam/op-outline.js | 5 +++++ src/kiri/mode/cam/op-rough.js | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/kiri/mode/cam/op-outline.js b/src/kiri/mode/cam/op-outline.js index 270f4c64..c9b7e275 100644 --- a/src/kiri/mode/cam/op-outline.js +++ b/src/kiri/mode/cam/op-outline.js @@ -100,6 +100,11 @@ class OpOutline extends CamOp { // extend cut thru (only when z bottom is 0) if (workarea.bottom_z < 0) { let last = slices[slices.length-1]; + // when step down > full cut depth, clear slices and + // leave only the cut-thru pass(es) + if (op.down > workarea.top_stock - workarea.bottom_part) { + slices.length = 0; + } for (let zneg of base_util.lerp(0, -workarea.bottom_cut, op.down)) { if (!last) continue; let add = last.clone(true); diff --git a/src/kiri/mode/cam/op-rough.js b/src/kiri/mode/cam/op-rough.js index 341f56d8..beb24827 100644 --- a/src/kiri/mode/cam/op-rough.js +++ b/src/kiri/mode/cam/op-rough.js @@ -32,11 +32,12 @@ class OpRough extends CamOp { let roughStock = op.all && isIndexed; let toolDiam = new Tool(settings, op.tool).fluteDiameter(); let trueShadow = process.camTrueShadow === true; + let cutThruBypass = op.down > workarea.top_stock - workarea.bottom_part; updateToolDiams(toolDiam); // clear the stock above the area to be roughed out - if (workarea.top_z > workarea.top_part) { + if (workarea.top_z > workarea.top_part && !cutThruBypass) { let shadow = state.shadow.base.clone(); let step = toolDiam * op.step; let inset = roughStock ? @@ -258,6 +259,12 @@ class OpRough extends CamOp { let last = slices[slices.length-1]; + // when step down > full cut depth, clear slices and + // leave only the cut-thru pass(es) + if (cutThruBypass) { + slices.length = 0; + } + // add cut thru passes if (workarea.bottom_z < 0) for (let zneg of base_util.lerp(0, -workarea.bottom_cut, op.down)) { if (!last) continue;