Skip to content

Commit ee81026

Browse files
committed
fix erroneous tab match in cpu contouring
1 parent a4af3a9 commit ee81026

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

src/kiri/mode/cam/topo3.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export class Topo {
3333
minY = bounds.min.y,
3434
maxY = bounds.max.y,
3535
zBottom = contour.bottom ? workarea.bottom_z : 0,
36-
zMin = workarea.bottom_z + 0.0001, //Math.max(bounds.min.z, zBottom) + 0.0001,
36+
zMin = workarea.bottom_z + 0.0001,
3737
boundsX = maxX - minX,
3838
boundsY = maxY - minY,
3939
inside = contour.inside,
@@ -474,7 +474,8 @@ export class Topo {
474474
...params,
475475
box,
476476
lines: rec.lines,
477-
gridx: rec.index
477+
gridx: rec.index,
478+
slice
478479
});
479480

480481
return slice;
@@ -657,7 +658,6 @@ export class Probe {
657658
let iy = Math.round(ry * (py - minY));
658659
return data[ix * stepsY + iy] || zMin;
659660
};
660-
661661
}
662662

663663
}
@@ -848,7 +848,7 @@ export class Trace {
848848
checkr.y = y;
849849
// when tabs are on and this point is inside the
850850
// tab polygon, ensure z is at least tabHeight
851-
if (clipTab && tv < tabHeight && inClip(clipTab, tv, checkr)) {
851+
if (clipTab && clipTab.length && tv < tabHeight && inClip(clipTab, tv, checkr)) {
852852
tv = this.tabZ;
853853
}
854854
// if the value is on the floor and inside the clip
@@ -886,7 +886,7 @@ export class Trace {
886886
checkr.y = y;
887887
// when tabs are on and this point is inside the
888888
// tab polygon, ensure z is at least tabHeight
889-
if (clipTab && tv < tabHeight && inClip(clipTab, tv, checkr)) {
889+
if (clipTab && clipTab.length && tv < tabHeight && inClip(clipTab, tv, checkr)) {
890890
tv = this.tabZ;
891891
}
892892
// if the value is on the floor and inside the clip

src/kiri/run/minion.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ const funcs = self.minion = {
254254
trace_y(data, seq) {
255255
const { trace } = cache.trace;
256256
trace.crossY_sync(data.params, slice => {
257+
// console.log('w',slice);
257258
slice = codec.encode(slice);
258259
reply({ seq, slice });
259260
});

0 commit comments

Comments
 (0)