Skip to content

Commit

Permalink
Fixed unnecessary travels after calling the avoid crossing perimeters…
Browse files Browse the repository at this point in the history
… when the wipe is enabled.

When the avoid crossing perimeters was enabled, and the wipe was enabled, there were unnecessary travels in the opposite direction than the wipe travel.
  • Loading branch information
hejllukas committed Feb 18, 2021
1 parent 86d7e1f commit 8f293f0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/libslic3r/GCode.cpp
Expand Up @@ -2853,10 +2853,10 @@ std::string GCode::travel_to(const Point &point, ExtrusionRole role, std::string
Point last_post_before_retract = this->last_pos();
gcode += this->retract();
// When "Wipe while retracting" is enabled, then extruder moves to another position, and travel from this position can cross perimeters.
// Because of it, it is necessary to call avoid crossing perimeters for the path between previous last_post and last_post after calling retraction()
// Because of it, it is necessary to call avoid crossing perimeters again with new starting point after calling retraction()
// FIXME Lukas H.: Try to predict if this second calling of avoid crossing perimeters will be needed or not. It could save computations.
if (last_post_before_retract != this->last_pos() && m_config.avoid_crossing_perimeters) {
Polyline retract_travel = m_avoid_crossing_perimeters.travel_to(*this, last_post_before_retract);
append(retract_travel.points, travel.points);
Polyline retract_travel = m_avoid_crossing_perimeters.travel_to(*this, point);
travel = std::move(retract_travel);
}
} else
Expand Down

0 comments on commit 8f293f0

Please sign in to comment.