From 43d9e38325d8190126b5ea5e7268a130dc978798 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Wed, 24 Mar 2021 09:37:39 +0100 Subject: [PATCH] Wipe tower: reorder extruders so first layer starts with soluble if possible That way it will not be wiped on first layer --- src/libslic3r/GCode/ToolOrdering.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/libslic3r/GCode/ToolOrdering.cpp b/src/libslic3r/GCode/ToolOrdering.cpp index 8520cf35bd..c45e260158 100644 --- a/src/libslic3r/GCode/ToolOrdering.cpp +++ b/src/libslic3r/GCode/ToolOrdering.cpp @@ -329,6 +329,16 @@ void ToolOrdering::reorder_extruders(unsigned int last_extruder_id) lt.extruders.front() = last_extruder_id; break; } + + // On first layer with wipe tower, prefer a soluble extruder + // at the beginning, so it is not wiped on the first layer. + if (lt == m_layer_tools[0] && m_print_config_ptr && m_print_config_ptr->wipe_tower) { + for (size_t i = 0; ifilament_soluble.get_at(lt.extruders[i]-1)) { // 1-based... + std::swap(lt.extruders[i], lt.extruders.front()); + break; + } + } } last_extruder_id = lt.extruders.back(); }