diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index d27160bc8..5c7e36042 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -4259,6 +4259,7 @@ Polyline GCode::travel_to(std::string &gcode, const Point &point, ExtrusionRole Polyline travel { this->last_pos(), point }; // check whether wipe could be disabled without causing visible stringing + //not used anymore, not reliable bool could_be_wipe_disabled = false; //can use the avoid crossing algo? @@ -4289,8 +4290,15 @@ Polyline GCode::travel_to(std::string &gcode, const Point &point, ExtrusionRole // generate G-code for the travel move if (needs_retraction) { - if (m_config.avoid_crossing_perimeters && could_be_wipe_disabled && EXTRUDER_CONFIG_WITH_DEFAULT(wipe_only_crossing, true)) - m_wipe.reset_path(); + if (m_config.avoid_crossing_perimeters && EXTRUDER_CONFIG_WITH_DEFAULT(wipe_only_crossing, true)) { + //if (could_be_wipe_disabled) { + // m_wipe.reset_path(); + //} else { + auto result = diff_pl(Polylines{ travel }, to_polygons(m_layer->lslices)); + if (result.empty()) + m_wipe.reset_path(); + //} + } Point last_post_before_retract = this->last_pos(); gcode += this->retract(); diff --git a/src/libslic3r/GCode/AvoidCrossingPerimeters.cpp b/src/libslic3r/GCode/AvoidCrossingPerimeters.cpp index cad59bd32..2e419f81e 100644 --- a/src/libslic3r/GCode/AvoidCrossingPerimeters.cpp +++ b/src/libslic3r/GCode/AvoidCrossingPerimeters.cpp @@ -1078,8 +1078,10 @@ Polyline AvoidCrossingPerimeters::travel_to(const GCode &gcodegen, const Point & *could_be_wipe_disabled = false; } else if (max_detour_length_exceeded) { *could_be_wipe_disabled = false; - } else - *could_be_wipe_disabled = !need_wipe(gcodegen, m_grid_lslice, travel, result_pl, travel_intersection_count); + } + // Not reliable enough, now using diff_pl(Polylines{ travel }, to_polygons(m_layer->lslices)); by the caller. supermerill/SuperSlicer#2154 +// else +// *could_be_wipe_disabled = !need_wipe(gcodegen, m_grid_lslice, travel, result_pl, travel_intersection_count); return result_pl; }