From 64185e3a4f76c7e1d086ed89337dc5575eb0b9f2 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Wed, 23 Dec 2020 15:10:49 -0500 Subject: [PATCH] checkpoint cam-op-pop editing --- notes.md | 1 + src/kiri/main.js | 10 +++++- src/mode/cam/client.js | 78 ++++++++++++++++++++++++++++++++++-------- src/mode/cam/ops.js | 6 ++-- web/kiri/lang/en.js | 2 ++ 5 files changed, 80 insertions(+), 17 deletions(-) diff --git a/notes.md b/notes.md index faecab1c..2ef310dd 100644 --- a/notes.md +++ b/notes.md @@ -60,6 +60,7 @@ # CAM +* `B` z thru doesn't respect step down * `B` failure to go *up* when moving between parts? * `B` starting export during animation unleashes chaos * `B` climb vs conventional not fully consistent after refactor diff --git a/src/kiri/main.js b/src/kiri/main.js index be13931d..fde3de6a 100644 --- a/src/kiri/main.js +++ b/src/kiri/main.js @@ -195,7 +195,15 @@ { name: "top" }, { name: "middle" }, { name: "bottom" } - ] + ], + regaxis: [ + { name: "X" }, + { name: "Y" } + ], + regpoints: [ + { name: "2" }, + { name: "3" } + ], }; const tweak = { diff --git a/src/mode/cam/client.js b/src/mode/cam/client.js index 04721734..ca8ae3fe 100644 --- a/src/mode/cam/client.js +++ b/src/mode/cam/client.js @@ -247,16 +247,16 @@ }); break; case api.ui.drX2Add: - drill = { axis: "x", points: 2 }; + drill = { axis: "X", points: 2 }; break; case api.ui.drX3Add: - drill = { axis: "x", points: 3 }; + drill = { axis: "X", points: 3 }; break; case api.ui.drY2Add: - drill = { axis: "y", points: 2 }; + drill = { axis: "Y", points: 2 }; break; case api.ui.drY3Add: - drill = { axis: "y", points: 3 }; + drill = { axis: "Y", points: 3 }; break; } if (drill) { @@ -729,22 +729,72 @@ 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}), - inside: UC.newBoolean(LANG.cr_olin_s, undefined, {title:LANG.cr_olin_l}), + inside: UC.newBoolean(LANG.cr_olin_s, undefined, {title:LANG.cr_olin_l}) }; createPopOp('outline').inputs = { - tool: UC.newSelect(LANG.cc_tool, {}, "tools"), - sep: UC.newBlank({class:"pop-sep"}), - spindle: UC.newInput(LANG.cc_spnd_s, {title:LANG.cc_spnd_l, convert:UC.toInt, show:hasSpindle}), - down: UC.newInput(LANG.cc_sdwn_s, {title:LANG.cc_sdwn_l, convert:UC.toFloat, units:true}), - step: UC.newInput(LANG.cc_sovr_s, {title:LANG.cc_sovr_l, convert:UC.toFloat, bound:UC.bound(0.01,1.0)}), - rate: UC.newInput(LANG.cc_feed_s, {title:LANG.cc_feed_l, convert:UC.toInt, units:true}), - plunge: UC.newInput(LANG.cc_plng_s, {title:LANG.cc_plng_l, convert:UC.toInt, units:true}), - sep: UC.newBlank({class:"pop-sep"}), + tool: UC.newSelect(LANG.cc_tool, {}, "tools"), + sep: UC.newBlank({class:"pop-sep"}), + spindle: UC.newInput(LANG.cc_spnd_s, {title:LANG.cc_spnd_l, convert:UC.toInt, show:hasSpindle}), + down: UC.newInput(LANG.cc_sdwn_s, {title:LANG.cc_sdwn_l, convert:UC.toFloat, units:true}), + step: UC.newInput(LANG.cc_sovr_s, {title:LANG.cc_sovr_l, convert:UC.toFloat, bound:UC.bound(0.01,1.0)}), + rate: UC.newInput(LANG.cc_feed_s, {title:LANG.cc_feed_l, convert:UC.toInt, units:true}), + plunge: UC.newInput(LANG.cc_plng_s, {title:LANG.cc_plng_l, convert:UC.toInt, units:true}), + sep: UC.newBlank({class:"pop-sep"}), dogbones: UC.newBoolean(LANG.co_dogb_s, undefined, {title:LANG.co_dogb_l, show:(op) => { return !op.inputs.wide.checked }}), inside: UC.newBoolean(LANG.co_olin_s, undefined, {title:LANG.co_olin_l, show:(op) => { return !op.inputs.outside.checked }}), outside: UC.newBoolean(LANG.co_olot_s, undefined, {title:LANG.co_olot_l, show:(op) => { return !op.inputs.inside.checked }}), - wide: UC.newBoolean(LANG.co_wide_s, undefined, {title:LANG.co_wide_l, show:(op) => { return !op.inputs.inside.checked }}), + wide: UC.newBoolean(LANG.co_wide_s, undefined, {title:LANG.co_wide_l, show:(op) => { return !op.inputs.inside.checked }}) + }; + + createPopOp('contour x').inputs = { + tool: UC.newSelect(LANG.cc_tool, {}, "tools"), + sep: UC.newBlank({class:"pop-sep"}), + spindle: UC.newInput(LANG.cc_spnd_s, {title:LANG.cc_spnd_l, convert:UC.toInt, show:hasSpindle}), + step: UC.newInput(LANG.cc_sovr_s, {title:LANG.cc_sovr_l, convert:UC.toFloat, bound:UC.bound(0.01,1.0)}), + rate: UC.newInput(LANG.cc_feed_s, {title:LANG.cc_feed_l, convert:UC.toInt, units:true}), + angle: UC.newInput(LANG.cf_angl_s, {title:LANG.cf_angl_l, convert:UC.toFloat, bound:UC.bound(45,90)}), + tolerance: UC.newInput(LANG.ou_toll_s, {title:LANG.ou_toll_l, convert:UC.toFloat, bound:UC.bound(0,10.0), units:true}), + 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}) + }; + + createPopOp('contour y').inputs = { + tool: UC.newSelect(LANG.cc_tool, {}, "tools"), + sep: UC.newBlank({class:"pop-sep"}), + spindle: UC.newInput(LANG.cc_spnd_s, {title:LANG.cc_spnd_l, convert:UC.toInt, show:hasSpindle}), + step: UC.newInput(LANG.cc_sovr_s, {title:LANG.cc_sovr_l, convert:UC.toFloat, bound:UC.bound(0.01,1.0)}), + rate: UC.newInput(LANG.cc_feed_s, {title:LANG.cc_feed_l, convert:UC.toInt, units:true}), + angle: UC.newInput(LANG.cf_angl_s, {title:LANG.cf_angl_l, convert:UC.toFloat, bound:UC.bound(45,90)}), + tolerance: UC.newInput(LANG.ou_toll_s, {title:LANG.ou_toll_l, convert:UC.toFloat, bound:UC.bound(0,10.0), units:true}), + 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}) + }; + + createPopOp('trace').inputs = { }; + + createPopOp('drill').inputs = { + tool: UC.newSelect(LANG.cc_tool, {}, "tools"), + sep: UC.newBlank({class:"pop-sep"}), + spindle: UC.newInput(LANG.cc_spnd_s, {title:LANG.cc_spnd_l, convert:UC.toInt, show:hasSpindle}), + down: UC.newInput(LANG.cc_sdwn_s, {title:LANG.cc_sdwn_l, convert:UC.toFloat, units:true}), + rate: UC.newInput(LANG.cc_feed_s, {title:LANG.cc_feed_l, convert:UC.toInt, units:true}), + dwell: UC.newInput(LANG.cd_dwll_s, {title:LANG.cd_dwll_l, convert:UC.toFloat}), + lift: UC.newInput(LANG.cd_lift_s, {title:LANG.cd_lift_l, convert:UC.toFloat, units:true}) + }; + + createPopOp('register').inputs = { + tool: UC.newSelect(LANG.cc_tool, {}, "tools"), + axis: UC.newSelect(LANG.cd_axis, {}, "regaxis"), + points: UC.newSelect(LANG.cd_points, {}, "regpoints"), + sep: UC.newBlank({class:"pop-sep"}), + spindle: UC.newInput(LANG.cc_spnd_s, {title:LANG.cc_spnd_l, convert:UC.toInt, show:hasSpindle}), + down: UC.newInput(LANG.cc_sdwn_s, {title:LANG.cc_sdwn_l, convert:UC.toFloat, units:true}), + rate: UC.newInput(LANG.cc_feed_s, {title:LANG.cc_feed_l, convert:UC.toInt, units:true}), + dwell: UC.newInput(LANG.cd_dwll_s, {title:LANG.cd_dwll_l, convert:UC.toFloat}), + lift: UC.newInput(LANG.cd_lift_s, {title:LANG.cd_lift_l, convert:UC.toFloat, units:true}) }; }; diff --git a/src/mode/cam/ops.js b/src/mode/cam/ops.js index 5e92f066..329bcf09 100644 --- a/src/mode/cam/ops.js +++ b/src/mode/cam/ops.js @@ -734,8 +734,9 @@ points = []; switch (op.axis) { + case "X": case "x": - if (op.points === 3) { + if (op.points == 3) { points.push(newPoint(bounds.min.x - dx, my, 0)); points.push(newPoint(bounds.max.x + dx, my - o3, 0)); points.push(newPoint(bounds.max.x + dx, my + o3, 0)); @@ -744,8 +745,9 @@ points.push(newPoint(bounds.max.x + dx, my, 0)); } break; + case "Y": case "y": - if (op.points === 3) { + if (op.points == 3) { points.push(newPoint(mx, bounds.min.y - dy, 0)); points.push(newPoint(mx - o3, bounds.max.y + dy, 0)); points.push(newPoint(mx + o3, bounds.max.y + dy, 0)); diff --git a/web/kiri/lang/en.js b/web/kiri/lang/en.js index d6cc5aac..fa5fd9e7 100644 --- a/web/kiri/lang/en.js +++ b/web/kiri/lang/en.js @@ -324,6 +324,8 @@ kiri.lang['en-us'] = { // CNC DRILLING cd_menu: "drill", + cd_axis: "axis", + cd_points: "points", cd_plpr_s: "plunge per", cd_plpr_l: "max plunge between\ndwell periods\nin workspace units\n0 to disable", cd_dwll_s: "dwell time",