Skip to content

Commit

Permalink
Make sure that after wipe tower toolchange the G1 Z is always emitted.
Browse files Browse the repository at this point in the history
Even if the G1 Z would be redundant, it is still emitted.
Fixes: prusa3d#12361
  • Loading branch information
SachCZ authored and lukasmatena committed Mar 25, 2024
1 parent bd903fd commit fa23ab8
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/libslic3r/GCode/WipeTowerIntegration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,10 @@ std::string WipeTowerIntegration::append_tcr(GCodeGenerator &gcodegen, const Wip
gcodegen.m_wipe.reset_path(); // We don't want wiping on the ramming lines.
toolchange_gcode_str = gcodegen.set_extruder(new_extruder_id, tcr.print_z); // TODO: toolchange_z vs print_z
if (gcodegen.config().wipe_tower) {
if (tcr.priming) {
const double return_to_z{tcr.print_z + gcodegen.config().z_offset.value};
deretraction_str += gcodegen.writer().get_travel_to_z_gcode(return_to_z, "set priming layer Z");
} else {
deretraction_str += gcodegen.writer().travel_to_z(z, "restore layer Z");
}
deretraction_str += gcodegen.writer().get_travel_to_z_gcode(z, "restore layer Z");
Vec3d position{gcodegen.writer().get_position()};
position.z() = z;
gcodegen.writer().update_position(position);
deretraction_str += gcodegen.unretract();
}
}
Expand Down

0 comments on commit fa23ab8

Please sign in to comment.