From aedf73ba956206558edccae591f201c32ad3c79b Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Thu, 23 Feb 2023 22:12:01 -0500 Subject: [PATCH] decrease cutting speed when entire tool is engaged in roughing --- notes.md | 1 - release.md | 1 + src/kiri-mode/cam/prepare.js | 10 ++++++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/notes.md b/notes.md index 4b64d198..a97071d2 100644 --- a/notes.md +++ b/notes.md @@ -111,7 +111,6 @@ * `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 add minion threading -* `P` decrease cutting speed when entire tool is engaged (start of roughing, rest machining) * `P` port arc code from FDM export to CAM export * `P` redo all path route / planning in prepare to account for terrain before camOut diff --git a/release.md b/release.md index 57dc47fb..34238359 100644 --- a/release.md +++ b/release.md @@ -6,6 +6,7 @@ Full docs @ https://docs.grid.space/projects/kiri-moto # Release 3.9 * more graceful handling of security contexts blocking SharedArrayBuffer +* CAM decrease cutting speed when entire tool is engaged in roughing * CAM add dogbones support to traces ops * CAM add scripted contour filtering (to be extended to other ops) * CAM add calculation of taper length from angle diff --git a/src/kiri-mode/cam/prepare.js b/src/kiri-mode/cam/prepare.js index 652cd151..e764e0d5 100644 --- a/src/kiri-mode/cam/prepare.js +++ b/src/kiri-mode/cam/prepare.js @@ -100,6 +100,7 @@ function prepEach(widget, settings, print, firstPoint, update) { layerOut = [], printPoint, isNewMode, + isRough, isLathe, tool, toolType, @@ -294,7 +295,7 @@ function prepEach(widget, settings, print, firstPoint, update) { ); } - function camOut(point, cut, moveLen = toolDiamMove) { + function camOut(point, cut, moveLen = toolDiamMove, factor = 1) { point = point.clone(); point.x += wmx; point.y += wmy; @@ -311,7 +312,7 @@ function prepEach(widget, settings, print, firstPoint, update) { nextIsMove = false; } - let rate = feedRate; + let rate = feedRate * factor; // before first point, move cutting head to point above it // then set that new point as the lastPoint @@ -467,6 +468,7 @@ function prepEach(widget, settings, print, firstPoint, update) { nextIsMove = true; currentOp = op.op; isLathe = currentOp.type === 'lathe'; + isRough = currentOp.type === 'rough'; let weight = op.weight(); newLayer(op.op); op.prepare(ops, (progress, message) => { @@ -493,12 +495,12 @@ function prepEach(widget, settings, print, firstPoint, update) { let last = null; if (easeDown && poly.isClosed()) { last = poly.forEachPointEaseDown(function(point, offset) { - camOut(point.clone(), offset > 0); + camOut(point.clone(), offset > 0, undefined, isRough && count === 1 ? 0.5 : 1); }, fromPoint); } else { poly.forEachPoint(function(point, pidx, points, offset) { last = point; - camOut(point.clone(), offset !== 0); + camOut(point.clone(), offset !== 0, undefined, isRough && count === 1 ? 0.5 : 1); }, poly.isClosed(), index); } newLayer();