mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-11 21:09:06 +08:00
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
@ -298,7 +298,11 @@ std::string GCodeWriter::travel_to_xyz(const Vec3d &point, const std::string &co
|
|||||||
used for unlift. */
|
used for unlift. */
|
||||||
if (!this->will_move_z(point(2))) {
|
if (!this->will_move_z(point(2))) {
|
||||||
double nominal_z = m_pos(2) - m_lifted;
|
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));
|
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. */
|
reducing the lift amount that will be used for unlift. */
|
||||||
if (!this->will_move_z(z)) {
|
if (!this->will_move_z(z)) {
|
||||||
double nominal_z = m_pos(2) - m_lifted;
|
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 "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user