From 3375a12d35cdbda6bbfe2b3b1a6627841f35fb4e Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Tue, 30 Nov 2021 21:52:48 -0500 Subject: [PATCH] only remove subsequent anchors in multi-material mode --- src/mode/fdm/slice.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/mode/fdm/slice.js b/src/mode/fdm/slice.js index 199e47dd..f3bc9966 100644 --- a/src/mode/fdm/slice.js +++ b/src/mode/fdm/slice.js @@ -103,7 +103,18 @@ }); // ignore first widget widgets.shift(); - // remove anchor slices from other widgets + // count extruders used + let ext = []; + for (let w of widgets) { + if (w.anno && w.anno.extruder >= 0) { + let e = w.anno.extruder; + if (ext.indexOf(e) < 0) { + ext.push(e); + } + } + } + // 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); }