From 821e19ed03398e7c4a5299cd7db21a002a937239 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Sat, 31 Dec 2022 21:09:05 -0500 Subject: [PATCH] output spindle at the start of every op. #237 --- notes.md | 2 ++ src/kiri-mode/cam/export.js | 11 ++++++----- web/kiri/lang/en.js | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/notes.md b/notes.md index 294b2641..51712c50 100644 --- a/notes.md +++ b/notes.md @@ -101,6 +101,8 @@ * `F` ease-in and ease-out especially on tab cut-out start/stop * `F` maintain several part orientations + op chains in a single profile +* `P` inner corner arc moves +* `P` log Z interpolation for contour XYZ moves * `P` option to start with the smallest poly by area on layer change * `P` refactor slicing engine to use common core in geo * `P` decrease cutting speed when entire tool is engaged (start of roughing, rest machining) diff --git a/src/kiri-mode/cam/export.js b/src/kiri-mode/cam/export.js index 9c567b96..ecc9fd51 100644 --- a/src/kiri-mode/cam/export.js +++ b/src/kiri-mode/cam/export.js @@ -194,7 +194,7 @@ CAM.export = function(print, online) { } // on spindle change (deferred from layer transition so it's post-toolchange) - if ((changeTool && spindleMax) || (newSpindle && newSpindle !== spindle)) { + if (spindleMax && newSpindle && (changeTool || newSpindle !== spindle || opt.newOp)) { spindle = newSpindle; if (!laserOp) { if (spindle > 0) { @@ -413,7 +413,8 @@ CAM.export = function(print, online) { } } const firstOut = layerout[0]; - if (newmode && !newmode.silent && mode !== newmode) { + const newOp = newmode && !newmode.silent && mode !== newmode; + if (newOp) { if (mode && !stripComments) { append("; ending " + mode.type + " op after " + Math.round(time/60) + " seconds"); } @@ -427,13 +428,13 @@ CAM.export = function(print, online) { } newSpindle = layerout.spindle; // iterate over layer output records - for (let out of layerout) { + layerout.forEach((out, ind) => { if (out.gcode && Array.isArray(out.gcode)) { filterEmit(out.gcode, consts); } else { - moveTo(out); + moveTo(out, { newOp: ind === 0 ? newOp : false }); } - } + }); if (lasering && laserOp) { // disable laser filterEmit(laserOp.off, consts); diff --git a/web/kiri/lang/en.js b/web/kiri/lang/en.js index 9909b99b..15f1531b 100644 --- a/web/kiri/lang/en.js +++ b/web/kiri/lang/en.js @@ -338,7 +338,7 @@ self.kiri.lang['en-us'] = { // FDM FILL fi_menu: "infill", fi_type: "fill type", - fi_pcnt_s: "fill fraction", + fi_pcnt_s: "fill amount", fi_pcnt_l: ["fill density values","0.0 - 1.0"], fi_rept_s: "fill repeat", fi_rept_l: ["number of times to repeat","unchanged fill layers"],