diff --git a/src/libslic3r/GCode/ToolOrdering.cpp b/src/libslic3r/GCode/ToolOrdering.cpp index 7a4caba6d..c2925b566 100644 --- a/src/libslic3r/GCode/ToolOrdering.cpp +++ b/src/libslic3r/GCode/ToolOrdering.cpp @@ -562,18 +562,10 @@ void ToolOrdering::fill_wipe_tower_partitions(const PrintConfig &config, coordf_ for (int i = int(m_layer_tools.size()) - 2; i >= 0; -- i) m_layer_tools[i].wipe_tower_partitions = std::max(m_layer_tools[i + 1].wipe_tower_partitions, m_layer_tools[i].wipe_tower_partitions); - // if enable_timelapse_print(), update all layer_tools parameters: wipe_tower_partitions - if (config.timelapse_type == TimelapseType::tlSmooth) { - for (LayerTools& layer_tools : m_layer_tools) { - if (layer_tools.wipe_tower_partitions == 0) { - layer_tools.wipe_tower_partitions = 1; - } - } - } - //FIXME this is a hack to get the ball rolling. for (LayerTools < : m_layer_tools) - lt.has_wipe_tower = (lt.has_object && lt.wipe_tower_partitions > 0) || lt.print_z < object_bottom_z + EPSILON; + lt.has_wipe_tower = (lt.has_object && (config.timelapse_type == TimelapseType::tlSmooth || lt.wipe_tower_partitions > 0)) + || lt.print_z < object_bottom_z + EPSILON; // Test for a raft, insert additional wipe tower layer to fill in the raft separation gap. for (size_t i = 0; i + 1 < m_layer_tools.size(); ++ i) { diff --git a/src/libslic3r/GCode/ToolOrdering.hpp b/src/libslic3r/GCode/ToolOrdering.hpp index d0b60e2c8..b6de13b26 100644 --- a/src/libslic3r/GCode/ToolOrdering.hpp +++ b/src/libslic3r/GCode/ToolOrdering.hpp @@ -183,7 +183,7 @@ public: std::vector::const_iterator end() const { return m_layer_tools.end(); } bool empty() const { return m_layer_tools.empty(); } std::vector& layer_tools() { return m_layer_tools; } - bool has_wipe_tower() const { return ! m_layer_tools.empty() && m_first_printing_extruder != (unsigned int)-1 && m_layer_tools.front().wipe_tower_partitions > 0; } + bool has_wipe_tower() const { return ! m_layer_tools.empty() && m_first_printing_extruder != (unsigned int)-1 && m_layer_tools.front().has_wipe_tower; } private: void initialize_layers(std::vector &zs); diff --git a/src/libslic3r/GCode/WipeTower.cpp b/src/libslic3r/GCode/WipeTower.cpp index 0c3df5019..5a17525c9 100644 --- a/src/libslic3r/GCode/WipeTower.cpp +++ b/src/libslic3r/GCode/WipeTower.cpp @@ -1066,7 +1066,7 @@ WipeTower::box_coordinates WipeTower::align_perimeter(const WipeTower::box_coord return aligned_box; } -WipeTower::ToolChangeResult WipeTower::finish_layer(bool extrude_perimeter) +WipeTower::ToolChangeResult WipeTower::finish_layer(bool extrude_perimeter, bool extruder_fill) { assert(! this->layer_finished()); m_current_layer_finished = true; @@ -1105,7 +1105,7 @@ WipeTower::ToolChangeResult WipeTower::finish_layer(bool extrude_perimeter) const float dy = (fill_box.lu.y() - fill_box.ld.y() - m_perimeter_width); float left = fill_box.lu.x() + 2*m_perimeter_width; float right = fill_box.ru.x() - 2 * m_perimeter_width; - if (dy > m_perimeter_width) + if (extruder_fill && dy > m_perimeter_width) { writer.travel(fill_box.ld + Vec2f(m_perimeter_width * 2, 0.f)) .append(";--------------------\n" @@ -1500,7 +1500,7 @@ void WipeTower::generate(std::vector> & if (m_enable_timelapse_print) { timelapse_wall = only_generate_out_wall(); } - finish_layer_tcr = finish_layer(m_enable_timelapse_print ? false : true); + finish_layer_tcr = finish_layer(m_enable_timelapse_print ? false : true, layer.extruder_fill); } for (int i=0; i> & if (i == idx) { layer_result.emplace_back(tool_change(layer.tool_changes[i].new_tool, m_enable_timelapse_print ? false : true)); // finish_layer will be called after this toolchange - finish_layer_tcr = finish_layer(false); + finish_layer_tcr = finish_layer(false, layer.extruder_fill); } else { layer_result.emplace_back(tool_change(layer.tool_changes[i].new_tool)); diff --git a/src/libslic3r/GCode/WipeTower.hpp b/src/libslic3r/GCode/WipeTower.hpp index 271e9180f..de84a604a 100644 --- a/src/libslic3r/GCode/WipeTower.hpp +++ b/src/libslic3r/GCode/WipeTower.hpp @@ -157,8 +157,11 @@ public: float get_depth() const { return m_wipe_tower_depth; } float get_brim_width() const { return m_wipe_tower_brim_width_real; } - - + void set_last_layer_extruder_fill(bool extruder_fill) { + if (!m_plan.empty()) { + m_plan.back().extruder_fill = extruder_fill; + } + } // Switch to a next layer. @@ -218,7 +221,7 @@ public: // Fill the unfilled space with a sparse infill. // Call this method only if layer_finished() is false. - ToolChangeResult finish_layer(bool extruder_perimeter = true); + ToolChangeResult finish_layer(bool extruder_perimeter = true, bool extruder_fill = true); // Is the current layer finished? bool layer_finished() const { @@ -378,6 +381,7 @@ private: float height; // layer height float depth; // depth of the layer based on all layers above float extra_spacing; + bool extruder_fill{true}; float toolchanges_depth() const { float sum = 0.f; for (const auto &a : tool_changes) sum += a.required_depth; return sum; } std::vector tool_changes; diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index bd84d2082..5389b003b 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -1871,8 +1871,11 @@ void Print::_make_wipe_tower() layer_tools.wiping_extrusions().ensure_perimeters_infills_order(*this); // if enable timelapse, slice all layer - if (enable_timelapse_print()) + if (enable_timelapse_print()) { + if (layer_tools.wipe_tower_partitions == 0) + wipe_tower.set_last_layer_extruder_fill(false); continue; + } if (&layer_tools == &m_wipe_tower_data.tool_ordering.back() || (&layer_tools + 1)->wipe_tower_partitions == 0) break;