From 0842d235a36b42ed111e431cfa3dee5de42b1866 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Sat, 28 Nov 2020 10:35:46 -0500 Subject: [PATCH] fix multiple tab heights in contouring --- notes.md | 1 - src/kiri/init.js | 2 +- src/mode/cam/slice.js | 2 +- src/mode/cam/topo.js | 22 +++++++++++++++------- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/notes.md b/notes.md index 3564a92d..e9a6b72b 100644 --- a/notes.md +++ b/notes.md @@ -66,7 +66,6 @@ # CAM -* `B` fix multiple tab heights in contouring (uses highest now) * `B` climb vs conventional not fully consistent after refactor * `B` outside cutting direction in roughing mode inverted * `B` clear voids has double interior pass because wrong offset shadow used diff --git a/src/kiri/init.js b/src/kiri/init.js index 6097a3fc..2b8db45e 100644 --- a/src/kiri/init.js +++ b/src/kiri/init.js @@ -1614,7 +1614,7 @@ sliceSolidMinArea: UC.newInput(LANG.ad_msol_s, {title:LANG.ad_msol_l, convert:UC.toFloat, modes:FDM, expert:true}), outputMinSpeed: UC.newInput(LANG.ad_mins_s, {title:LANG.ad_mins_l, bound:UC.bound(5,200), convert:UC.toFloat, modes:FDM, expert:true}), outputCoastDist: UC.newInput(LANG.ad_scst_s, {title:LANG.ad_scst_l, bound:UC.bound(0.0,10), convert:UC.toFloat, modes:FDM, expert:true}), - outputShortPoly: UC.newInput(LANG.ad_spol_s, {title:LANG.ad_spol_l, bound:UC.bound(0,200), convert:UC.toFloat, modes:FDM, expert:true}), + outputShortPoly: UC.newInput(LANG.ad_spol_s, {title:LANG.ad_spol_l, bound:UC.bound(0,10000), convert:UC.toFloat, modes:FDM, expert:true}), fdmSep: UC.newBlank({class:"pop-sep", modes:FDM}), zHopDistance: UC.newInput(LANG.ad_zhop_s, {title:LANG.ad_zhop_l, bound:UC.bound(0,3.0), convert:UC.toFloat, modes:FDM, expert:true}), antiBacklash: UC.newInput(LANG.ad_abkl_s, {title:LANG.ad_abkl_l, bound:UC.bound(0,3), convert:UC.toInt, modes:FDM, expert:true}), diff --git a/src/mode/cam/slice.js b/src/mode/cam/slice.js index b2b6a5d5..f93435c0 100644 --- a/src/mode/cam/slice.js +++ b/src/mode/cam/slice.js @@ -148,7 +148,7 @@ let terrain = slicer.slice(tzindex, { each: (data, index, total) => { tshadow = POLY.union(tshadow.appendAll(data.tops), 0.01, true); tslices.push(data.slice); - if (true) { + if (false) { const slice = data.slice; sliceAll.push(slice); slice.output() diff --git a/src/mode/cam/topo.js b/src/mode/cam/topo.js index 9386fa17..ce1541ce 100644 --- a/src/mode/cam/topo.js +++ b/src/mode/cam/topo.js @@ -74,7 +74,11 @@ debug_topo_shells = debug && true; if (tabs) { - clipTab.appendAll(tabs.map(tab => POLY.expand([tab.poly], toolDiameter/2)).flat()); + clipTab.appendAll(tabs.map(tab => { + let ctab = POLY.expand([tab.poly], toolDiameter/2); + ctab.forEach(ct => ct.z = tab.dim.z); + return ctab; + }).flat()); } // debug clipTab and clipTo @@ -257,16 +261,20 @@ } const checkr = newPoint(0,0); - const inClip = function(polys) { + const inClip = function(polys, checkZ) { checkr.x = x; checkr.y = y; for (let i=0; i