mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-10 00:07:51 -06:00
Added documentation why gcode0 was defined to be the same as gcode1
This commit is contained in:
parent
3c9010fde4
commit
69b8a06eca
1 changed files with 8 additions and 2 deletions
|
@ -131,11 +131,13 @@ class GCodeReader(MeshReader):
|
||||||
x = params.x if params.x is not None else x
|
x = params.x if params.x is not None else x
|
||||||
y = params.y if params.y is not None else y
|
y = params.y if params.y is not None else y
|
||||||
z_changed = False
|
z_changed = False
|
||||||
|
|
||||||
if params.z is not None:
|
if params.z is not None:
|
||||||
if z != params.z:
|
if z != params.z:
|
||||||
z_changed = True
|
z_changed = True
|
||||||
self._previous_z = z
|
self._previous_z = z
|
||||||
z = params.z
|
z = params.z
|
||||||
|
|
||||||
if params.e is not None:
|
if params.e is not None:
|
||||||
if params.e > e[self._extruder_number]:
|
if params.e > e[self._extruder_number]:
|
||||||
path.append([x, y, z, self._layer_type]) # extrusion
|
path.append([x, y, z, self._layer_type]) # extrusion
|
||||||
|
@ -144,6 +146,7 @@ class GCodeReader(MeshReader):
|
||||||
e[self._extruder_number] = params.e
|
e[self._extruder_number] = params.e
|
||||||
else:
|
else:
|
||||||
path.append([x, y, z, LayerPolygon.MoveCombingType])
|
path.append([x, y, z, LayerPolygon.MoveCombingType])
|
||||||
|
|
||||||
if z_changed:
|
if z_changed:
|
||||||
if not self._is_layers_in_file:
|
if not self._is_layers_in_file:
|
||||||
if len(path) > 1 and z > 0:
|
if len(path) > 1 and z > 0:
|
||||||
|
@ -152,8 +155,12 @@ class GCodeReader(MeshReader):
|
||||||
path.clear()
|
path.clear()
|
||||||
else:
|
else:
|
||||||
path.clear()
|
path.clear()
|
||||||
|
|
||||||
return self._position(x, y, z, e)
|
return self._position(x, y, z, e)
|
||||||
|
|
||||||
|
# G0 and G1 should be handled exactly the same.
|
||||||
|
_gCode1 = _gCode0
|
||||||
|
|
||||||
def _gCode28(self, position, params, path):
|
def _gCode28(self, position, params, path):
|
||||||
return self._position(
|
return self._position(
|
||||||
params.x if params.x is not None else position.x,
|
params.x if params.x is not None else position.x,
|
||||||
|
@ -164,14 +171,13 @@ class GCodeReader(MeshReader):
|
||||||
def _gCode92(self, position, params, path):
|
def _gCode92(self, position, params, path):
|
||||||
if params.e is not None:
|
if params.e is not None:
|
||||||
position.e[self._extruder_number] = params.e
|
position.e[self._extruder_number] = params.e
|
||||||
|
|
||||||
return self._position(
|
return self._position(
|
||||||
params.x if params.x is not None else position.x,
|
params.x if params.x is not None else position.x,
|
||||||
params.y if params.y is not None else position.y,
|
params.y if params.y is not None else position.y,
|
||||||
params.z if params.z is not None else position.z,
|
params.z if params.z is not None else position.z,
|
||||||
position.e)
|
position.e)
|
||||||
|
|
||||||
_gCode1 = _gCode0
|
|
||||||
|
|
||||||
def _processGCode(self, G, line, position, path):
|
def _processGCode(self, G, line, position, path):
|
||||||
func = getattr(self, "_gCode%s" % G, None)
|
func = getattr(self, "_gCode%s" % G, None)
|
||||||
x = self._getFloat(line, "X")
|
x = self._getFloat(line, "X")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue