diff --git a/release.md b/release.md index f16ddb39..b25f1854 100644 --- a/release.md +++ b/release.md @@ -9,6 +9,7 @@ Full docs @ https://docs.grid.space/projects/kiri-moto * CAM add open poly-line offsetting with trace op * CAM clearly delineate ops reachable or not on timeline * CAM add 4th axis lathe operation for debug and testing (can be optimized) +* CAM add rough all stock to aid lathe mode - add auto-disable for ops mismatched to axis indexed state - remove clear top (always on) - add z top (like z bottom) diff --git a/src/kiri-mode/cam/client.js b/src/kiri-mode/cam/client.js index ecb38f2c..716119ad 100644 --- a/src/kiri-mode/cam/client.js +++ b/src/kiri-mode/cam/client.js @@ -1212,6 +1212,10 @@ CAM.init = function(kiri, api) { SPACE.update(); } + function hasIndexing() { + return isIndexed; + } + function hasSpindle() { return current.device.spindleMax > 0; } @@ -1245,6 +1249,7 @@ CAM.init = function(kiri, api) { rate: 'camRoughSpeed', plunge: 'camRoughPlunge', leave: 'camRoughStock', + all: 'camRoughAll', voids: 'camRoughVoid', flats: 'camRoughFlat', inside: 'camRoughIn', @@ -1260,6 +1265,7 @@ CAM.init = function(kiri, api) { step: UC.newInput(LANG.cc_sovr_s, {title:LANG.cc_sovr_l, convert:UC.toFloat, bound:UC.bound(0.01,1.0)}), leave: UC.newInput(LANG.cr_lsto_s, {title:LANG.cr_lsto_l, convert:UC.toFloat, units:true}), sep: UC.newBlank({class:"pop-sep"}), + all: UC.newBoolean(LANG.cr_clst_s, undefined, {title:LANG.cr_clst_l, show:hasIndexing}), voids: UC.newBoolean(LANG.cr_clrp_s, undefined, {title:LANG.cr_clrp_l}), flats: UC.newBoolean(LANG.cr_clrf_s, undefined, {title:LANG.cr_clrf_l}), top: UC.newBoolean(LANG.cr_clrt_s, undefined, {title:LANG.cr_clrt_l}), diff --git a/src/kiri-mode/cam/ops.js b/src/kiri-mode/cam/ops.js index 3eab9125..2bcd406b 100644 --- a/src/kiri-mode/cam/ops.js +++ b/src/kiri-mode/cam/ops.js @@ -180,6 +180,7 @@ class OpRough extends CamOp { let roughTop = op.top; let roughDown = op.down; let roughLeave = op.leave; + let roughStock = op.all && state.isIndexed; let toolDiam = new CAM.Tool(settings, op.tool).fluteDiameter(); let trueShadow = process.camTrueShadow === true; @@ -306,7 +307,9 @@ class OpRough extends CamOp { // shell = shadow expanded by half tool diameter + leave stock const sadd = roughIn ? toolDiam / 2 : toolDiam / 2; - const shell = POLY.offset(shadow, sadd + roughLeave); + const shell = roughStock ? + [ newPolygon().centerRectangle(stock.center, stock.x, stock.y) ] : + POLY.offset(shadow, sadd + roughLeave); slices.forEach((slice, index) => { let offset = [shell.clone(true),slice.shadow.clone(true)].flat(); diff --git a/src/kiri-mode/cam/topo4.js b/src/kiri-mode/cam/topo4.js index 19d1f22d..f8c460ef 100644 --- a/src/kiri-mode/cam/topo4.js +++ b/src/kiri-mode/cam/topo4.js @@ -107,13 +107,15 @@ class Topo4 { range.min -= this.diam / 2; range.max += this.diam / 2; - // merge in tab vertices (so they don't affect slice range / dimensions) + // merge in tab vertices here so they don't affect slice range / dimensions for (let i=0, l=tabverts.length; i