Skip to content

Commit

Permalink
Add offset to the finalize wipe tower move
Browse files Browse the repository at this point in the history
  • Loading branch information
SachCZ authored and lukasmatena committed Mar 22, 2024
1 parent 9b050bf commit cdcd4da
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/libslic3r/GCode/WipeTowerIntegration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,10 @@ std::string WipeTowerIntegration::tool_change(GCodeGenerator &gcodegen, int extr
std::string WipeTowerIntegration::finalize(GCodeGenerator &gcodegen)
{
std::string gcode;
if (std::abs(gcodegen.writer().get_position().z() - m_final_purge.print_z) > EPSILON)
const double purge_z{m_final_purge.print_z + gcodegen.config().z_offset.value};
if (std::abs(gcodegen.writer().get_position().z() - purge_z) > EPSILON)
gcode += gcodegen.generate_travel_gcode(
{{gcodegen.last_position->x(), gcodegen.last_position->y(), scaled(m_final_purge.print_z)}},
{{gcodegen.last_position->x(), gcodegen.last_position->y(), scaled(purge_z)}},
"move to safe place for purging", [](){return "";}
);
gcode += append_tcr(gcodegen, m_final_purge, -1);
Expand Down

0 comments on commit cdcd4da

Please sign in to comment.