diff --git a/release.md b/release.md index 8fe3183c..41c9e4c9 100644 --- a/release.md +++ b/release.md @@ -21,7 +21,7 @@ Full docs @ https://docs.grid.space/projects/kiri-moto * CAM stock is now always on, whether offset or absolute * CAM add lathe worker parallelization (2x - 6x speedup) * CAM fix pocket/trace selection with flip op -- fix lathe yellow path in light mode +- CAM fix lathe yellow path in light mode # Release 3.8 (2023-01-21) diff --git a/src/kiri-mode/cam/animate2.js b/src/kiri-mode/cam/animate2.js index aad8f304..f3c87e9c 100644 --- a/src/kiri-mode/cam/animate2.js +++ b/src/kiri-mode/cam/animate2.js @@ -454,7 +454,7 @@ kiri.load(() => { pathIndex++; // console.log(next.point.z); - if (next.tool >= 0 && (!tool || tool.getNumber() !== next.tool)) { + if (next.tool && (!tool || tool.getID() !== next.tool.getID())) { // on real tool change, go to safe Z first if (tool && last.point) { let pos = last.point = { @@ -465,7 +465,7 @@ kiri.load(() => { toolMove(pos); send.data(toolUpdateMsg); } - toolUpdate(next.tool, send); + toolUpdate(next.tool.getID(), send); } const id = toolID; @@ -582,11 +582,11 @@ kiri.load(() => { } // delete old tool mesh, generate tool mesh, send to client - function toolUpdate(toolnum, send) { + function toolUpdate(toolid, send) { if (tool) { send.data({ mesh_del: toolID }); } - tool = new CAM.Tool({ tools }, undefined, toolnum); + tool = new CAM.Tool({ tools }, toolid); const Instance = CSG.Instance(); const slen = tool.shaftLength() || 15; const srad = tool.shaftDiameter() / 2; diff --git a/src/kiri-mode/cam/prepare.js b/src/kiri-mode/cam/prepare.js index 572d701e..085db1eb 100644 --- a/src/kiri-mode/cam/prepare.js +++ b/src/kiri-mode/cam/prepare.js @@ -478,7 +478,7 @@ function prepEach(widget, settings, print, firstPoint, update) { opSum += weight; if (tool && lastPoint) { newLayer(); - camOut(printPoint = lastPoint.clone().setZ(zmax + zadd)); + layerPush(printPoint = lastPoint.clone().setZ(zmax + zadd), 0, 0, tool); newLayer(); } } diff --git a/src/kiri-mode/cam/topo4.js b/src/kiri-mode/cam/topo4.js index e8bdba05..9053b532 100644 --- a/src/kiri-mode/cam/topo4.js +++ b/src/kiri-mode/cam/topo4.js @@ -73,6 +73,7 @@ class Topo4 { this.diam = tool.fluteDiameter(); this.zoff = widget.track.top || 0; this.leave = op.leave || 0; + this.lineColor = state.settings.controller.dark ? 0xffff00 : 0x555500; onupdate(0, "lathe"); @@ -352,7 +353,7 @@ class Topo4 { const repeat = poly.points[0]; slice.camLines[0].push(repeat.clone().setA(repeat.a - 360)); slice.output() - .setLayer("lathe", { line: 0xffff00 }) + .setLayer("lathe", { line: this.lineColor }) .addPoly(poly.clone().applyRotations().move({ z: -zoff, x:0, y:0 })); } @@ -428,7 +429,7 @@ class Topo4 { const repeat = poly.points[0]; slice.camLines[0].push(repeat.clone().setA(repeat.a - 360)); slice.output() - .setLayer("lathe", { line: 0xffff00 }) + .setLayer("lathe", { line: this.lineColor }) .addPoly(poly.clone().applyRotations().move({ z: -zoff, x:0, y:0 })); }