Avoid collisions when moving Z down #7208
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Avoid collisions with previous extrusions in the same layer when moving Z down in an XYZ move. This happens for example when starting a scarf joint after another perimeter was already printed.
Fixes #7191
Description
Set
set_current_position_clear
tofalse
in GCodeWriter.cpp for any XYZ travel move that moves below the "nominal Z height", which I assume means the current layer printing height. This causes the move to be split into an XY move followed by a Z move in the logic below.I found this solution cleaner than inserting special case handling in every branch of
GCodeWriter::travel_to_xyz
, since it uses the move splitting logic that is already there and proven to work.Screenshots/Recordings/Graphs
The offending move is split into XY and then Z components. Compare screenshots in #7191.
Tests