From 0c49de940e41de42fafec23a77a65e50ab63cc00 Mon Sep 17 00:00:00 2001 From: supermerill Date: Wed, 1 Dec 2021 19:52:36 +0100 Subject: [PATCH] Call needs_retraction at the right time supermerill/SuperSlicer#1967 --- src/libslic3r/GCode.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index e397c198f..7198c1d85 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -4149,9 +4149,8 @@ Polyline GCode::travel_to(std::string &gcode, const Point &point, ExtrusionRole this->origin in order to get G-code coordinates. */ Polyline travel { this->last_pos(), point }; - // check whether a straight travel move would need retraction + // check / compute avoid_crossing_perimeters bool will_cross_perimeter = this->can_cross_perimeter(travel); - bool needs_retraction = will_cross_perimeter && this->needs_retraction(travel, role); // check whether wipe could be disabled without causing visible stringing bool could_be_wipe_disabled = false; @@ -4163,11 +4162,11 @@ Polyline GCode::travel_to(std::string &gcode, const Point &point, ExtrusionRole && m_avoid_crossing_perimeters.is_init() && !(m_config.avoid_crossing_not_first_layer && this->on_first_layer())) { travel = m_avoid_crossing_perimeters.travel_to(*this, point, &could_be_wipe_disabled); - // check again whether the new travel path still needs a retraction - needs_retraction = this->needs_retraction(travel, role); - //if (needs_retraction && m_layer_index > 1) exit(0); } + // check whether a straight travel move would need retraction + bool needs_retraction = this->needs_retraction(travel, role); + // Re-allow avoid_crossing_perimeters for the next travel moves m_avoid_crossing_perimeters.reset_once_modifiers();