Fix unreliable wipe_only_crossing

supermerill/SuperSlicer#2154
This commit is contained in:
remi durand 2022-01-26 23:32:07 +01:00 committed by supermerill
parent 8d362ad897
commit 64be2e0355
2 changed files with 14 additions and 4 deletions

View File

@ -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();

View File

@ -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;
}