From 09109a896d58b56d78a9b48ebdd80702e22e4d2b Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Wed, 11 Jan 2023 21:55:08 -0500 Subject: [PATCH] add CAM control to omit initial tool change --- release.md | 12 ++++++++---- src/kiri-mode/cam/export.js | 4 +++- src/kiri/conf.js | 1 + src/kiri/init.js | 1 + web/kiri/lang/en.js | 2 ++ 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/release.md b/release.md index 89bffd35..6c2912ca 100644 --- a/release.md +++ b/release.md @@ -9,15 +9,19 @@ Full docs @ https://docs.grid.space/projects/kiri-moto * add new fdm parameters, range overrides * various fixes and improvements to CAM indexing * various fixes and improvements to gcode variables -* move to save Z between CAM ops, refresh spindle speed +* CAM move to save Z between ops, refresh spindle speed * improve gcode arc import decoding * improve trace line selection with zoom adaptive thresholds -* add CAM origin offset optional parameters +* CAM add origin offset optional parameters * remove auto-decimation on object import -* fix FDM raft line fill strategy +* FDM fix raft line fill strategy * slicing memory reduction from team lychee -* option to control first CAM output point order +* option to control first output point order +* CAM add control to omit initial tool change + - refactor object/group storage model in Mesh:Tool +- select near or vertical pocket faces +- add omit pocket to rough and outline # Release 3.7 (2022-11-12) diff --git a/src/kiri-mode/cam/export.js b/src/kiri-mode/cam/export.js index 10962578..33120fc4 100644 --- a/src/kiri-mode/cam/export.js +++ b/src/kiri-mode/cam/export.js @@ -34,6 +34,7 @@ CAM.export = function(print, online) { output = [], spindle = 0, newSpindle = 0, + toolChanges = 0, spindleMax = device.spindleMax, origin = settings.origin || { x: 0, y: 0, z: 0 }, space = device.gcodeSpace ? ' ' : '', @@ -188,9 +189,10 @@ CAM.export = function(print, online) { pos.t = out.tool; consts.tool = pos.t; consts.tool_name = toolNameByNumber(out.tool); - if (!laserOp) { + if (!laserOp && (spro.camToolInit || toolChanges > 0)) { filterEmit(cmdToolChange, { ...consts, spindle: newSpindle } ); } + toolChanges++; } // on spindle change (deferred from layer transition so it's post-toolchange) diff --git a/src/kiri/conf.js b/src/kiri/conf.js index ef84e43a..07598731 100644 --- a/src/kiri/conf.js +++ b/src/kiri/conf.js @@ -582,6 +582,7 @@ const conf = exports({ camTrueShadow: false, camForceZMax: false, camFirstZMax: false, + camToolInit: true, ops: [], // current ops op2: [] // flip ops } diff --git a/src/kiri/init.js b/src/kiri/init.js index d6f3478f..8e178355 100644 --- a/src/kiri/init.js +++ b/src/kiri/init.js @@ -1974,6 +1974,7 @@ gapp.register("kiri.init", [], (root, exports) => { camConventional: uc.newBoolean(LANG.ou_conv_s, onBooleanClick, {title:LANG.ou_conv_l, modes:CAM}), camEaseDown: uc.newBoolean(LANG.cr_ease_s, onBooleanClick, {title:LANG.cr_ease_l, modes:CAM}), camDepthFirst: uc.newBoolean(LANG.ou_depf_s, onBooleanClick, {title:LANG.ou_depf_l, modes:CAM}), + camToolInit: uc.newBoolean(LANG.ou_toin_s, onBooleanClick, {title:LANG.ou_toin_l, modes:CAM}), fdmSep: uc.newBlank({class:"pop-sep", modes:FDM_CAM}), camFirstZMax: uc.newBoolean(LANG.ou_z1st_s, onBooleanClick, {title:LANG.ou_z1st_l, modes:CAM}), camForceZMax: uc.newBoolean(LANG.ou_forz_s, onBooleanClick, {title:LANG.ou_forz_l, modes:CAM}), diff --git a/web/kiri/lang/en.js b/web/kiri/lang/en.js index 027f6608..afc61913 100644 --- a/web/kiri/lang/en.js +++ b/web/kiri/lang/en.js @@ -676,6 +676,8 @@ self.kiri.lang['en-us'] = { ou_conv_l: ["milling direction","uncheck for 'climb'"], ou_depf_s: "depth first", ou_depf_l: ["optimize pocket cuts","with depth priority"], + ou_toin_s: "tool init", + ou_toin_l: "emit tool change with first operation", ou_forz_s: "force z max", ou_forz_l: "all moves between pockets will go to z max (above stock). this is usually required if you are not performing a roughing operation before pocketing operations.", ou_z1st_s: "first z max",