Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid collisions when moving Z down #7208

Merged
merged 3 commits into from
Oct 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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