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:
parent
ed1f1ca45a
commit
4c9356ff84
2 changed files with 12 additions and 5 deletions
|
|
@ -63,8 +63,6 @@ FDM.sliceAll = function(settings, onupdate) {
|
||||||
.sort((a,b) => {
|
.sort((a,b) => {
|
||||||
return a.slices[0].z - b.slices[0].z
|
return a.slices[0].z - b.slices[0].z
|
||||||
});
|
});
|
||||||
// ignore first widget
|
|
||||||
widgets.shift();
|
|
||||||
// count extruders used
|
// count extruders used
|
||||||
let ext = [];
|
let ext = [];
|
||||||
for (let w of widgets) {
|
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)
|
// remove anchor slices from other widgets (only with multi-material)
|
||||||
if (ext.length > 1)
|
if (ext.length > 1) {
|
||||||
for (let w of widgets) {
|
for (let w of widgets) {
|
||||||
w.slices = w.slices.filter(s => s.index >= 0);
|
w.slices = w.slices.filter(s => s.index >= 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,8 @@ self.alert = function(o) {
|
||||||
console.log(o);
|
console.log(o);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
self.uuid = ((Math.random() * Date.now()) | 0).toString(36);
|
||||||
|
|
||||||
function minhandler(msg) {
|
function minhandler(msg) {
|
||||||
let data = msg.data;
|
let data = msg.data;
|
||||||
let seq = data.seq;
|
let seq = data.seq;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue