fix 0/1 bucket slicing in slicer2

This commit is contained in:
Stewart Allen 2020-11-11 15:38:14 -05:00
commit f41d166199
3 changed files with 6 additions and 2 deletions

View file

@ -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;

View file

@ -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});

View file

@ -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));
}
}