From a5c53c1ac6d04fddb1171e164d42e6cccb6455f1 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Wed, 5 Oct 2022 11:12:40 -0400 Subject: [PATCH] allow contour op to disregard z bottom --- release.md | 4 ++++ src/kiri-mode/cam/client.js | 6 ++++-- src/kiri-mode/cam/topo.js | 2 +- src/kiri/conf.js | 1 + web/kiri/lang/en.js | 2 ++ 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/release.md b/release.md index 5dd51d68..7fec94b2 100644 --- a/release.md +++ b/release.md @@ -13,6 +13,10 @@ Full docs @ https://docs.grid.space/projects/kiri-moto * add configurable flatness for contour clipping * add faster render mode for FDM slices * add axis label remapping in FDM +* add new path rendering engine +* add bridging option in CAM contouring +* add option to force z max routing in CAM +* add option to ignore z bottom in CAM contouring * extend url loading of workspaces to all formats * alert when healing is enabled and non-manifold geometries are detected * fix thin output start and end point tracking which broke retraction diff --git a/src/kiri-mode/cam/client.js b/src/kiri-mode/cam/client.js index 61aca86c..a283f264 100644 --- a/src/kiri-mode/cam/client.js +++ b/src/kiri-mode/cam/client.js @@ -1009,6 +1009,7 @@ CAM.init = function(kiri, api) { tolerance: 'camTolerance', flatness: 'camFlatness', bridging: 'camContourBridge', + bottom: 'camContourBottom', curves: 'camContourCurves', inside: 'camContourIn', axis: 'X' @@ -1026,7 +1027,8 @@ CAM.init = function(kiri, api) { bridging: UC.newInput(LANG.ou_brdg_s, {title:LANG.ou_brdg_l, convert:UC.toFloat, bound:UC.bound(0,1000.0), units:true, round:4, show:(op) => op.inputs.curves.checked}), sep: UC.newBlank({class:"pop-sep"}), curves: UC.newBoolean(LANG.cf_curv_s, undefined, {title:LANG.cf_curv_l}), - inside: UC.newBoolean(LANG.cf_olin_s, undefined, {title:LANG.cf_olin_l}) + inside: UC.newBoolean(LANG.cf_olin_s, undefined, {title:LANG.cf_olin_l}), + bottom: UC.newBoolean(LANG.cf_botm_s, undefined, {title:LANG.cf_botm_l, show:(op,conf) => conf.process.camZBottom}) }; createPopOp('trace', { @@ -1173,7 +1175,7 @@ function createPopOp(type, map) { for (let inp of Object.values(op.inputs)) { let parent = inp.parentElement; if (parent.setVisible && parent.__opt.show) { - parent.setVisible(parent.__opt.show(op)); + parent.setVisible(parent.__opt.show(op, API.conf.get())); } } }, diff --git a/src/kiri-mode/cam/topo.js b/src/kiri-mode/cam/topo.js index e6dea627..f54c9d78 100644 --- a/src/kiri-mode/cam/topo.js +++ b/src/kiri-mode/cam/topo.js @@ -39,7 +39,7 @@ class Topo { maxX = bounds.max.x, minY = bounds.min.y, maxY = bounds.max.y, - zBottom = proc.camZBottom, + zBottom = contour.bottom ? proc.camZBottom : 0, zMin = Math.max(bounds.min.z, zBottom) + 0.0001, boundsX = maxX - minX, boundsY = maxY - minY, diff --git a/src/kiri/conf.js b/src/kiri/conf.js index 6cec05a7..82c079d3 100644 --- a/src/kiri/conf.js +++ b/src/kiri/conf.js @@ -487,6 +487,7 @@ const conf = exports({ camContourOver: 0.5, camContourSpeed: 1000, camContourAngle: 85, + camContourBottom: false, camContourCurves: false, camContourIn: false, camContourXOn: true, diff --git a/web/kiri/lang/en.js b/web/kiri/lang/en.js index 077bd685..c0f687c7 100644 --- a/web/kiri/lang/en.js +++ b/web/kiri/lang/en.js @@ -493,6 +493,8 @@ self.kiri.lang['en-us'] = { cn_menu: "contour", cf_angl_s: "max angle", cf_angl_l: ["angles greater than this","are considered vertical"], + cf_botm_s: "z bottom", + cf_botm_l: ["obey z bottom limit"], cf_curv_s: "curves only", cf_curv_l: ["limit linear cleanup","to curved surfaces"], cf_olin_s: "inside only",