GCodeWriter.cpp: Fixed skipped z-lifts when its height was equal to layer height (https://github.com/prusa3d/PrusaSlicer/issues/2154)
This commit is contained in:
parent
30ca60272c
commit
42c5c19f1c
1 changed files with 8 additions and 2 deletions
|
@ -298,7 +298,11 @@ std::string GCodeWriter::travel_to_xyz(const Vec3d &point, const std::string &co
|
|||
used for unlift. */
|
||||
if (!this->will_move_z(point(2))) {
|
||||
double nominal_z = m_pos(2) - m_lifted;
|
||||
m_lifted = m_lifted - (point(2) - nominal_z);
|
||||
m_lifted -= (point(2) - nominal_z);
|
||||
// In case that retract_lift == layer_height we could end up with almost zero in_m_lifted
|
||||
// and a retract could be skipped (https://github.com/prusa3d/PrusaSlicer/issues/2154
|
||||
if (std::abs(m_lifted) < EPSILON)
|
||||
m_lifted = 0.;
|
||||
return this->travel_to_xy(to_2d(point));
|
||||
}
|
||||
|
||||
|
@ -324,7 +328,9 @@ std::string GCodeWriter::travel_to_z(double z, const std::string &comment)
|
|||
reducing the lift amount that will be used for unlift. */
|
||||
if (!this->will_move_z(z)) {
|
||||
double nominal_z = m_pos(2) - m_lifted;
|
||||
m_lifted = m_lifted - (z - nominal_z);
|
||||
m_lifted -= (z - nominal_z);
|
||||
if (std::abs(m_lifted) < EPSILON)
|
||||
m_lifted = 0.;
|
||||
return "";
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue