Skip to content

Commit

Permalink
Avoid collisions when moving Z down (SoftFever#7208)
Browse files Browse the repository at this point in the history
Avoid collisions with previous extrusions in the same layer when moving Z down in an XYZ move.
This happens for example when starting a scarf joint after another perimeter was already printed.

Fixes SoftFever#7191

Co-authored-by: SoftFever <[email protected]>
  • Loading branch information
fritzw and SoftFever authored Oct 27, 2024
1 parent 661efa7 commit cf6d9c7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/libslic3r/GCodeWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,12 @@ std::string GCodeWriter::travel_to_xyz(const Vec3d &point, const std::string &co
// this function, fix it first.
//std::terminate();

// Orca: If moving down during below the current layer nominal Z, force XY->Z moves to avoid collisions with previous extrusions
double nominal_z = m_pos(2) - m_lifted;
if (point(2) < nominal_z - EPSILON) { // EPSILON to avoid false matches due to rounding errors
this->set_current_position_clear(false); // This forces XYZ moves to be split into XY->Z
}

/* If target Z is lower than current Z but higher than nominal Z we
don't perform the Z move but we only move in the XY plane and
adjust the nominal Z by reducing the lift amount that will be
Expand Down

0 comments on commit cf6d9c7

Please sign in to comment.