Commit 54bdf39f authored by Guillaume Seguin's avatar Guillaume Seguin

Cleanup gcoder.Gcode._preprocess_layers

parent 8855fe3f
...@@ -375,19 +375,16 @@ class GCode(object): ...@@ -375,19 +375,16 @@ class GCode(object):
count_noe = self.filament_length <= 0 count_noe = self.filament_length <= 0
for line in self.lines: for line in self.lines:
if not line.is_move and line.command != "G92" and line.command != "G28": if line.is_move and (line.extruding or count_noe):
continue if line.current_x is not None:
if line.is_move: xmin = min(xmin, line.current_x)
if line.e or count_noe: xmax = max(xmax, line.current_x)
if line.current_x is not None: if line.current_y is not None:
xmin = min(xmin, line.current_x) ymin = min(ymin, line.current_y)
xmax = max(xmax, line.current_x) ymax = max(ymax, line.current_y)
if line.current_y is not None: if line.current_z is not None:
ymin = min(ymin, line.current_y) zmin = min(zmin, line.current_z)
ymax = max(ymax, line.current_y) zmax = max(zmax, line.current_z)
if line.current_z is not None:
zmin = min(zmin, line.current_z)
zmax = max(zmax, line.current_z)
self.xmin = xmin if not math.isinf(xmin) else 0 self.xmin = xmin if not math.isinf(xmin) else 0
self.xmax = xmax if not math.isinf(xmax) else 0 self.xmax = xmax if not math.isinf(xmax) else 0
......
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