diff --git a/src/kiri/slicer2.js b/src/kiri/slicer2.js index 7e00c746..6ce970e9 100644 --- a/src/kiri/slicer2.js +++ b/src/kiri/slicer2.js @@ -268,7 +268,7 @@ } const haslines = lines.length || opt.emptyok; - const hastops = !opt.genso || retn.tops.length || opt.notopok; + const hastops = !opt.genso || opt.notopok || (retn.tops && retn.tops.length); if (opt.each && haslines && hastops) { opt.each(retn, index, total, UTIL.time() - mark); diff --git a/src/mode/cam/prepare.js b/src/mode/cam/prepare.js index a22aa4e7..2fab8ed9 100644 --- a/src/mode/cam/prepare.js +++ b/src/mode/cam/prepare.js @@ -258,10 +258,10 @@ if ((bigXY || bigZ) && (isMove || midZ)) { let maxz = getZClearPath( terrain, - lastPoint.x, - lastPoint.y, - point.x, - point.y, + lastPoint.x - wmx, + lastPoint.y - wmy, + point.x - wmx, + point.y - wmy, Math.max(point.z, lastPoint.z), zadd, maxToolDiam/2,