diff options
author | supermerill <merill@free.fr> | 2021-12-29 01:49:06 +0300 |
---|---|---|
committer | supermerill <merill@free.fr> | 2021-12-29 01:49:06 +0300 |
commit | d2c6929192ef4dc222f9d9d6422b929cc1bc9813 (patch) | |
tree | ce61e33990601aa65dab21d5840cb6213454e6ef /src | |
parent | 5ac295a83f196d35a79a08d38a0c0dd35c44696b (diff) |
fix broken travel (update of last pos on wipe)
supermerill/SuperSlicer#2112
Diffstat (limited to 'src')
-rw-r--r-- | src/libslic3r/GCode.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 362127cc0..9279d42f3 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -3090,7 +3090,7 @@ std::string GCode::extrude_loop_vase(const ExtrusionLoop &original_loop, const s z_per_length * line_length / nb_sections }; coordf_t current_height_internal = current_height + height_increment / 2; //ensure you go to the good xyz - if( (last_point - previous).norm() > EPSILON) + if ((last_point - previous).norm() > EPSILON) gcode += m_writer.extrude_to_xyz(last_point, 0, description); //extrusions for (int i = 0; i < nb_sections - 1; i++) { @@ -4286,13 +4286,18 @@ Polyline GCode::travel_to(std::string &gcode, const Point &point, ExtrusionRole 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. + bool updated_first_pos = false; if (last_post_before_retract != this->last_pos() && can_avoid_cross_peri) { // 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) { // Because of it, it is necessary to redo the thing travel = m_avoid_crossing_perimeters.travel_to(*this, point); + updated_first_pos = true; } } + if (!updated_first_pos) { + travel.points.front() = this->last_pos(); + } } else { // Reset the wipe path when traveling, so one would not wipe along an old path. m_wipe.reset_path(); |