Commit a73bfc12 authored by Guillaume Seguin's avatar Guillaume Seguin

Minor cleanup in GCoder

parent 1877d2cc
...@@ -109,22 +109,22 @@ class Layer(list): ...@@ -109,22 +109,22 @@ class Layer(list):
y = current_y + (y or 0) y = current_y + (y or 0)
z = current_z + (z or 0) z = current_z + (z or 0)
else: else:
if line.x: x = line.x + offset_x if x is not None: x = x + offset_x
if line.y: y = line.y + offset_y if y is not None: y = y + offset_y
if line.z: z = line.z + offset_z if z is not None: z = z + offset_z
current_x = x or current_x current_x = x or current_x
current_y = y or current_y current_y = y or current_y
current_z = z or current_z current_z = z or current_z
if line.e or not ignore_noe: if line.e or not ignore_noe:
if x: if x is not None:
xmin = min(xmin, x) xmin = min(xmin, x)
xmax = max(xmax, x) xmax = max(xmax, x)
if y: if y is not None:
ymin = min(ymin, y) ymin = min(ymin, y)
ymax = max(ymax, y) ymax = max(ymax, y)
if current_z: if current_z is not None:
zmin = min(zmin, current_z) zmin = min(zmin, current_z)
zmax = max(zmax, current_z) zmax = max(zmax, current_z)
...@@ -132,9 +132,9 @@ class Layer(list): ...@@ -132,9 +132,9 @@ class Layer(list):
if not any([line.x, line.y, line.z]): if not any([line.x, line.y, line.z]):
current_x = current_y = current_z = 0 current_x = current_y = current_z = 0
else: else:
if line.x: current_x = 0 if line.x is not None: current_x = 0
if line.y: current_y = 0 if line.y is not None: current_y = 0
if line.z: current_z = 0 if line.z is not None: current_z = 0
elif line.command == "G92": elif line.command == "G92":
if host_mode: if host_mode:
...@@ -142,9 +142,9 @@ class Layer(list): ...@@ -142,9 +142,9 @@ class Layer(list):
current_y = line.y or current_y current_y = line.y or current_y
current_z = line.z or current_z current_z = line.z or current_z
else: else:
if line.x: offset_x = current_x - line.x if line.x is not None: offset_x = current_x - line.x
if line.y: offset_y = current_y - line.y if line.y is not None: offset_y = current_y - line.y
if line.z: offset_z = current_z - line.z if line.z is not None: offset_z = current_z - line.z
line.current_x = current_x line.current_x = current_x
line.current_y = current_y line.current_y = current_y
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment