diff options
author | Ghostkeeper <rubend@tutanota.com> | 2021-11-05 23:04:37 +0300 |
---|---|---|
committer | Ghostkeeper <rubend@tutanota.com> | 2021-11-05 23:04:37 +0300 |
commit | fd5b2482967686d29dce783df9814b5979c572d0 (patch) | |
tree | 965af4ae3ffb2f636abd0e0bd224942f48767a2e /plugins | |
parent | 74ff28cbeaa0ac9222b80690ea63c0da1bd29a1c (diff) |
Don't register a new layer if not extruding a line
We do retracts/unretracts on different heights sometimes, for instance after a pause. This would get seen as a new layer. It's quite safe to say that purely retracts and unretracts on a different height do not constitute a layer in a normal g-code file. There would be nothing to draw anyway.
Contributes to issue CURA-8522. Fixes #10282.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/GCodeReader/FlavorParser.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/GCodeReader/FlavorParser.py b/plugins/GCodeReader/FlavorParser.py index 48a81324f6..bb99aa59ec 100644 --- a/plugins/GCodeReader/FlavorParser.py +++ b/plugins/GCodeReader/FlavorParser.py @@ -198,7 +198,7 @@ class FlavorParser: # Only when extruding we can determine the latest known "layer height" which is the difference in height between extrusions # Also, 1.5 is a heuristic for any priming or whatsoever, we skip those. - if z > self._previous_z and (z - self._previous_z < 1.5): + if z > self._previous_z and (z - self._previous_z < 1.5) and (params.x is not None or params.y is not None): self._current_layer_thickness = z - self._previous_z # allow a tiny overlap self._previous_z = z elif self._previous_extrusion_value > e[self._extruder_number]: |