mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-03 08:20:51 +08:00
fix broken travel (update of last pos on wipe)
supermerill/SuperSlicer#2112
This commit is contained in:
parent
5ac295a83f
commit
d2c6929192
@ -4286,13 +4286,18 @@ Polyline GCode::travel_to(std::string &gcode, const Point &point, ExtrusionRole
|
|||||||
Point last_post_before_retract = this->last_pos();
|
Point last_post_before_retract = this->last_pos();
|
||||||
gcode += this->retract();
|
gcode += this->retract();
|
||||||
// When "Wipe while retracting" is enabled, then extruder moves to another position, and travel from this position can cross perimeters.
|
// When "Wipe while retracting" is enabled, then extruder moves to another position, and travel from this position can cross perimeters.
|
||||||
|
bool updated_first_pos = false;
|
||||||
if (last_post_before_retract != this->last_pos() && can_avoid_cross_peri) {
|
if (last_post_before_retract != this->last_pos() && can_avoid_cross_peri) {
|
||||||
// Is the distance is short enough to just shortcut it?
|
// Is the distance is short enough to just shortcut it?
|
||||||
if (last_post_before_retract.distance_to(this->last_pos()) > scale_d(EXTRUDER_CONFIG_WITH_DEFAULT(nozzle_diameter, 0.4)) * 2) {
|
if (last_post_before_retract.distance_to(this->last_pos()) > scale_d(EXTRUDER_CONFIG_WITH_DEFAULT(nozzle_diameter, 0.4)) * 2) {
|
||||||
// Because of it, it is necessary to redo the thing
|
// Because of it, it is necessary to redo the thing
|
||||||
travel = m_avoid_crossing_perimeters.travel_to(*this, point);
|
travel = m_avoid_crossing_perimeters.travel_to(*this, point);
|
||||||
|
updated_first_pos = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!updated_first_pos) {
|
||||||
|
travel.points.front() = this->last_pos();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Reset the wipe path when traveling, so one would not wipe along an old path.
|
// Reset the wipe path when traveling, so one would not wipe along an old path.
|
||||||
m_wipe.reset_path();
|
m_wipe.reset_path();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user