fix corner case with mid-layer slice z check

This commit is contained in:
Stewart Allen 2024-01-16 15:18:21 -05:00
commit 733d5b275f

View file

@ -289,17 +289,18 @@ FDM.slice = function(settings, widget, onupdate, ondone) {
// console.log({zIndexes, zHeights}); // console.log({zIndexes, zHeights});
} else { } else {
// simple based + fixed increment // simple based + fixed increment
while (z <= zMax) { while (true) {
// reduce slice position by half layer height
let realz = (z - (h / 2)).round(3);
if (realz > zMax) {
break;
}
zh.push(h); zh.push(h);
zi.push(z); zi.push(realz);
h = h1; h = h1;
z += h; z += h;
} }
} }
// reduce slice position by half layer height
for (let i=0; i<zi.length; i++) {
zi[i] = (zi[i] - zh[i] / 2).round(3);
}
return zi; return zi;
}, },
// slicer function (worker local or minion distributed) // slicer function (worker local or minion distributed)