Skip to content
This repository has been archived by the owner on Feb 20, 2018. It is now read-only.

Commit

Permalink
Merge pull request #4 from thunderbug1/patch-1
Browse files Browse the repository at this point in the history
fix to ignore empty paths
  • Loading branch information
martymcguire committed Apr 17, 2014
2 parents 2195ed3 + fcfefbc commit 11dd197
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/unicorn/entities.py
Expand Up @@ -74,15 +74,16 @@ def __str__(self):

def get_gcode(self,context):
"Emit gcode for drawing polyline"
for points in self.segments:
start = points[0]

context.codes.append("(" + str(self) + ")")
context.go_to_point(start[0],start[1])
context.start()
for point in points[1:]:
context.draw_to_point(point[0],point[1])
context.last = point
context.stop()
context.codes.append("")
if hasattr(self, 'segments'):
for points in self.segments:
start = points[0]

context.codes.append("(" + str(self) + ")")
context.go_to_point(start[0],start[1])
context.start()
for point in points[1:]:
context.draw_to_point(point[0],point[1])
context.last = point
context.stop()
context.codes.append("")

0 comments on commit 11dd197

Please sign in to comment.