From 9b0d3b1122ffc3b7c2211b0cdc2cb6de6be9b242 Mon Sep 17 00:00:00 2001 From: Garret Fick Date: Sun, 10 Jul 2016 15:07:17 +0800 Subject: Fix issue with chaning region mode via flash. Add options for controlling output from rendered gerber --- gerber/gerber_statements.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'gerber/gerber_statements.py') diff --git a/gerber/gerber_statements.py b/gerber/gerber_statements.py index 881e5bc..52e7ac3 100644 --- a/gerber/gerber_statements.py +++ b/gerber/gerber_statements.py @@ -886,7 +886,10 @@ class CoordStmt(Statement): @classmethod def move(cls, func, point): - return cls(func, point[0], point[1], None, None, CoordStmt.OP_MOVE, None) + if point: + return cls(func, point[0], point[1], None, None, CoordStmt.OP_MOVE, None) + # No point specified, so just write the function. This is normally for ending a region (D02*) + return cls(func, None, None, None, None, CoordStmt.OP_MOVE, None) @classmethod def line(cls, func, point): @@ -902,7 +905,10 @@ class CoordStmt(Statement): @classmethod def flash(cls, point): - return cls(None, point[0], point[1], None, None, CoordStmt.OP_FLASH, None) + if point: + return cls(None, point[0], point[1], None, None, CoordStmt.OP_FLASH, None) + else: + return cls(None, None, None, None, None, CoordStmt.OP_FLASH, None) def __init__(self, function, x, y, i, j, op, settings): """ Initialize CoordStmt class -- cgit