properly handle looping multiple parts when not in ranges

This commit is contained in:
Stewart Allen 2021-10-08 20:14:26 -04:00
commit 3f88586bcd

View file

@ -58,7 +58,7 @@
blastz = 0, blastz = 0,
process = settings.process, process = settings.process,
belt_add_y = (process.firstLayerYOffset || 0) - (print.belty || 0), belt_add_y = (process.firstLayerYOffset || 0) - (print.belty || 0),
loops = process.outputLoops || 0, oloops = process.outputLoops || 0,
zhop = process.zHopDistance || 0, // range zhop = process.zHopDistance || 0, // range
lineWidth = process.sliceLineWidth || 0, lineWidth = process.sliceLineWidth || 0,
seekMMM = process.outputSeekrate * 60, seekMMM = process.outputSeekrate * 60,
@ -143,12 +143,12 @@
} }
let rloops = []; let rloops = [];
if (loops > 0) { if (oloops > 0) {
// if loops set, loop entire part // if oloops set, loop entire part
rloops.push({ rloops.push({
start: layers[0].slice.index, start: layers[0].slice.index,
end: layers.last().slice.index, end: Infinity,
iter: loops - 1 iter: oloops - 1
}); });
} }
if (process.ranges) { if (process.ranges) {
@ -163,7 +163,7 @@
} }
} }
} }
loops = isBelt && rloops.length ? rloops : undefined; let loops = isBelt && rloops.length ? rloops : undefined;
(process.gcodePauseLayers || "").split(",").forEach(function(lv) { (process.gcodePauseLayers || "").split(",").forEach(function(lv) {
let v = parseInt(lv); let v = parseInt(lv);