fix for mutli-color, multi-extruder with purge tower and anchor on belt -- still has a render bug that will be hard to fix because render happens before anchor cleanup

This commit is contained in:
Stewart Allen 2022-12-13 19:55:31 -05:00
commit 4c9356ff84
2 changed files with 12 additions and 5 deletions

View file

@ -63,8 +63,6 @@ FDM.sliceAll = function(settings, onupdate) {
.sort((a,b) => {
return a.slices[0].z - b.slices[0].z
});
// ignore first widget
widgets.shift();
// count extruders used
let ext = [];
for (let w of widgets) {
@ -75,10 +73,17 @@ FDM.sliceAll = function(settings, onupdate) {
}
}
}
// sort widgets by first slice Z
widgets.sort((a,b) => {
return a.slices[0].z - b.slices[0].z;
});
// give first widget a pass since it should have the anchor
widgets.shift();
// remove anchor slices from other widgets (only with multi-material)
if (ext.length > 1)
for (let w of widgets) {
w.slices = w.slices.filter(s => s.index >= 0);
if (ext.length > 1) {
for (let w of widgets) {
w.slices = w.slices.filter(s => s.index >= 0);
}
}
};

View file

@ -55,6 +55,8 @@ self.alert = function(o) {
console.log(o);
};
self.uuid = ((Math.random() * Date.now()) | 0).toString(36);
function minhandler(msg) {
let data = msg.data;
let seq = data.seq;