diff --git a/src/kiri/slicer2.js b/src/kiri/slicer2.js index e2cc75a0..ce83376e 100644 --- a/src/kiri/slicer2.js +++ b/src/kiri/slicer2.js @@ -194,7 +194,7 @@ lines = [], zScale = this.zScale, buckets = this.buckets, - bucket = buckets.length ? buckets[Math.floor(z * zScale)] : points; + bucket = buckets.length ? buckets[Math.floor(z * zScale)] : this.points; if (onflat) { z += flatoff; diff --git a/src/mode/cam/slice.js b/src/mode/cam/slice.js index a85c6e1f..3fe2aff9 100644 --- a/src/mode/cam/slice.js +++ b/src/mode/cam/slice.js @@ -223,6 +223,8 @@ } }); + if (!offset) return; + // add outside pass if not inside only if (!insideOnly) { const outside = POLY.offset(shadow, roughToolDiam * proc.camRoughOver, {z: slice.z}); diff --git a/src/mode/cam/topo.js b/src/mode/cam/topo.js index 70340495..8add3c4e 100644 --- a/src/mode/cam/topo.js +++ b/src/mode/cam/topo.js @@ -293,10 +293,12 @@ stepsTotal += sindex.length * 2; if (proc.camContourXOn) stepsTotal += (maxX-minX) / toolStep; if (proc.camContourYOn) stepsTotal += (maxY-minY) / toolStep; + let slices = slicer.slice(sindex, { each: (data, index, total) => { onupdate(++stepsTaken, stepsTotal, "topo slice"); }, genso: true }); - processSlices(slices.map(data => data.slice)); + + processSlices(slices.filter(s => s.lines).map(data => data.slice)); } }