From 74c638c7181e7a8ca4d0f791545bbf5db8b86c2a Mon Sep 17 00:00:00 2001 From: Garret Fick Date: Thu, 19 May 2016 23:19:28 +0800 Subject: Fix issue where did not always switch into the G01 mode after G03 when the point was unchanged --- gerber/gerber_statements.py | 4 ++++ gerber/render/rs274x_backend.py | 2 ++ 2 files changed, 6 insertions(+) (limited to 'gerber') diff --git a/gerber/gerber_statements.py b/gerber/gerber_statements.py index aa25d0a..119df9d 100644 --- a/gerber/gerber_statements.py +++ b/gerber/gerber_statements.py @@ -887,6 +887,10 @@ class CoordStmt(Statement): def line(cls, func, point): return cls(func, point[0], point[1], None, None, CoordStmt.OP_DRAW, None) + @classmethod + def mode(cls, func): + return cls(func, None, None, None, None, None, None) + @classmethod def arc(cls, func, point, center): return cls(func, point[0], point[1], center[0], center[1], CoordStmt.OP_DRAW, None) diff --git a/gerber/render/rs274x_backend.py b/gerber/render/rs274x_backend.py index 48a55e7..3dc8c1a 100644 --- a/gerber/render/rs274x_backend.py +++ b/gerber/render/rs274x_backend.py @@ -169,6 +169,8 @@ class Rs274xContext(GerberContext): if point[0] != None or point[1] != None: self.body.append(CoordStmt.line(func, self._simplify_point(line.end))) self._pos = line.end + elif func: + self.body.append(CoordStmt.mode(func)) def _render_arc(self, arc, color): -- cgit