From ca83824f00558a544f9706990361f4135a8e0a99 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Sun, 5 Feb 2023 06:48:10 +0100 Subject: [PATCH] fix pocket + contour ... topo field was commented out --- src/kiri-mode/cam/ops.js | 2 +- src/kiri-mode/cam/topo.js | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/kiri-mode/cam/ops.js b/src/kiri-mode/cam/ops.js index 1454716d..fc620597 100644 --- a/src/kiri-mode/cam/ops.js +++ b/src/kiri-mode/cam/ops.js @@ -1270,7 +1270,7 @@ class OpPocket extends CamOp { conform(camLines, refine, engrave, progress) { const topo = this.topo; // re-segment polygon to a higher resolution - const hirez = refine > 0 ? camLines.map(p => p.segment(topo.tolerance * 2)) : camLines; + const hirez = camLines.map(p => p.segment(topo.tolerance * 2)); // walk points and offset from surface taking into account tool geometry let steps = hirez.length; let iter = 0; diff --git a/src/kiri-mode/cam/topo.js b/src/kiri-mode/cam/topo.js index f2b60ecf..b87a52fd 100644 --- a/src/kiri-mode/cam/topo.js +++ b/src/kiri-mode/cam/topo.js @@ -99,7 +99,8 @@ class Topo { } // console.log({ resolution, flatness }); - // this.tolerance = resolution; + // used by Pocket -> Contour + this.tolerance = resolution; if (tabs) { clipTab.appendAll(tabs.map(tab => { @@ -437,7 +438,7 @@ class Probe { constructor(params) { const { data, profile } = params; - const { stepsX, stepsY, boundsX, boundsY, zMin, minX, minY } = params; + const { stepsX, stepsY, boundsX, zMin, minX, minY } = params; this.params = params; @@ -448,7 +449,7 @@ class Probe { xl = sx - 1, yl = sy - 1; - let tx, ty, tz, gv, i = 0, mz = -1; + let gv, i = 0, mz = -1; while (i < profile.length) { // tool profile point x, y, and z offsets