mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
CURA-4577 Take into account relative movements in GCodes
This commit is contained in:
parent
b868f913c4
commit
a0304255d1
1 changed files with 11 additions and 5 deletions
|
@ -136,16 +136,22 @@ class GCodeReader(MeshReader):
|
|||
|
||||
def _gCode0(self, position, params, path):
|
||||
x, y, z, e = position
|
||||
x = params.x if params.x is not None else x
|
||||
y = params.y if params.y is not None else y
|
||||
z = params.z if params.z is not None else position.z
|
||||
if self._is_absolute_positioning:
|
||||
x = params.x if params.x is not None else x
|
||||
y = params.y if params.y is not None else y
|
||||
z = params.z if params.z is not None else position.z
|
||||
else:
|
||||
x = x + params.x if params.x is not None else x
|
||||
y = y + params.y if params.y is not None else y
|
||||
z = z + params.z if params.z is not None else position.z
|
||||
|
||||
if params.e is not None:
|
||||
if params.e > e[self._extruder_number]:
|
||||
new_extrusion_value = params.e if self._is_absolute_positioning else e[self._extruder_number] + params.e
|
||||
if new_extrusion_value > e[self._extruder_number]:
|
||||
path.append([x, y, z, self._layer_type]) # extrusion
|
||||
else:
|
||||
path.append([x, y, z, LayerPolygon.MoveRetractionType]) # retraction
|
||||
e[self._extruder_number] = params.e
|
||||
e[self._extruder_number] = new_extrusion_value
|
||||
|
||||
# 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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue