Commit 1d6157c7 authored by Guillaume Seguin's avatar Guillaume Seguin

Correctly handle empty GCoder start data

parent 8d85523a
...@@ -186,6 +186,8 @@ class GCode(object): ...@@ -186,6 +186,8 @@ class GCode(object):
self.filament_length = self._preprocess_extrusion() self.filament_length = self._preprocess_extrusion()
self._create_layers() self._create_layers()
self._preprocess_layers() self._preprocess_layers()
else:
self.lines = []
def __len__(self): def __len__(self):
return len(self.line_idxs) return len(self.line_idxs)
...@@ -198,10 +200,10 @@ class GCode(object): ...@@ -198,10 +200,10 @@ class GCode(object):
if not command: if not command:
return return
gline = Line(command) gline = Line(command)
self.lines.append(gline)
self._preprocess_lines([gline]) self._preprocess_lines([gline])
self._preprocess_extrusion([gline]) self._preprocess_extrusion([gline])
if store: if store:
self.lines.append(gline)
self.append_layer.append(gline) self.append_layer.append(gline)
self.layer_idxs.append(self.append_layer_id) self.layer_idxs.append(self.append_layer_id)
self.line_idxs.append(len(self.append_layer)) self.line_idxs.append(len(self.append_layer))
......
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