add offset to wipe follow path

This commit is contained in:
Stewart Allen 2021-02-09 18:29:43 -05:00
commit f71dedb5d5
2 changed files with 6 additions and 4 deletions

View file

@ -587,7 +587,7 @@
} }
} }
}); });
lastPoly = output.lastPoly = poly; lastPoly = slice.lastPoly = poly;
} }
} }

View file

@ -218,6 +218,7 @@
} }
} }
let lastPoly;
let lastLayer; let lastLayer;
let extruders = []; let extruders = [];
let extcount = 0; let extcount = 0;
@ -407,8 +408,8 @@
if (lastLayer && lastLayer.length) { if (lastLayer && lastLayer.length) {
let lastOut = lastLayer.last(); let lastOut = lastLayer.last();
lastOut.retract = true; lastOut.retract = true;
if (wipeDist && lastLayer.lastPoly && lastOut.point) { if (wipeDist && lastPoly && lastOut.point) {
print.addOutput(lastLayer, lastOut.point.followTo(lastLayer.lastPoly.center(true), wipeDist)); print.addOutput(lastLayer, lastOut.point.followTo(lastPoly.center(true).add(offset), wipeDist));
} }
} }
} }
@ -416,6 +417,8 @@
); );
lastOut = slice; lastOut = slice;
lastExt = lastOut.ext lastExt = lastOut.ext
lastPoly = slice.lastPoly;
lastLayer = layerout;
if (layerRetract && layerout.length) { if (layerRetract && layerout.length) {
layerout.last().retract = true; layerout.last().retract = true;
} }
@ -443,7 +446,6 @@
layerout.layer = layerno++; layerout.layer = layerno++;
update((layerno / cake.length) * 0.5, "prepare"); update((layerno / cake.length) * 0.5, "prepare");
lastLayer = layerout;
slices = []; slices = [];
layerout = []; layerout = [];
lastOut = undefined; lastOut = undefined;