From ee8102645502e81a2fc3a6ba00788e199fd3be2a Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Mon, 22 Dec 2025 13:54:20 -0500 Subject: [PATCH] fix erroneous tab match in cpu contouring --- src/kiri/mode/cam/topo3.js | 10 +++++----- src/kiri/run/minion.js | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/kiri/mode/cam/topo3.js b/src/kiri/mode/cam/topo3.js index 63999c71..7668dd18 100644 --- a/src/kiri/mode/cam/topo3.js +++ b/src/kiri/mode/cam/topo3.js @@ -33,7 +33,7 @@ export class Topo { minY = bounds.min.y, maxY = bounds.max.y, zBottom = contour.bottom ? workarea.bottom_z : 0, - zMin = workarea.bottom_z + 0.0001, //Math.max(bounds.min.z, zBottom) + 0.0001, + zMin = workarea.bottom_z + 0.0001, boundsX = maxX - minX, boundsY = maxY - minY, inside = contour.inside, @@ -474,7 +474,8 @@ export class Topo { ...params, box, lines: rec.lines, - gridx: rec.index + gridx: rec.index, + slice }); return slice; @@ -657,7 +658,6 @@ export class Probe { let iy = Math.round(ry * (py - minY)); return data[ix * stepsY + iy] || zMin; }; - } } @@ -848,7 +848,7 @@ export class Trace { checkr.y = y; // when tabs are on and this point is inside the // tab polygon, ensure z is at least tabHeight - if (clipTab && tv < tabHeight && inClip(clipTab, tv, checkr)) { + if (clipTab && clipTab.length && tv < tabHeight && inClip(clipTab, tv, checkr)) { tv = this.tabZ; } // if the value is on the floor and inside the clip @@ -886,7 +886,7 @@ export class Trace { checkr.y = y; // when tabs are on and this point is inside the // tab polygon, ensure z is at least tabHeight - if (clipTab && tv < tabHeight && inClip(clipTab, tv, checkr)) { + if (clipTab && clipTab.length && tv < tabHeight && inClip(clipTab, tv, checkr)) { tv = this.tabZ; } // if the value is on the floor and inside the clip diff --git a/src/kiri/run/minion.js b/src/kiri/run/minion.js index 749d9462..d8436f87 100644 --- a/src/kiri/run/minion.js +++ b/src/kiri/run/minion.js @@ -254,6 +254,7 @@ const funcs = self.minion = { trace_y(data, seq) { const { trace } = cache.trace; trace.crossY_sync(data.params, slice => { + // console.log('w',slice); slice = codec.encode(slice); reply({ seq, slice }); });