From 3ffa9238c401cf0a872e1abae872a356d5f15f95 Mon Sep 17 00:00:00 2001 From: Paulo Henrique Silva Date: Sun, 26 Oct 2014 22:26:50 -0200 Subject: Add simple hack to allow evaluation when gerber have macros and polygon --- gerber/rs274x.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'gerber') diff --git a/gerber/rs274x.py b/gerber/rs274x.py index 08c492a..c01f027 100644 --- a/gerber/rs274x.py +++ b/gerber/rs274x.py @@ -412,9 +412,11 @@ class GerberParser(object): elif stmt.op == "D03": primitive = copy.deepcopy(self.apertures[self.aperture]) - primitive.position = (x, y) - primitive.level_polarity = self.level_polarity - self.primitives.append(primitive) + # XXX: temporary fix because there are no primitives for Macros and Polygon + if primitive is not None: + primitive.position = (x, y) + primitive.level_polarity = self.level_polarity + self.primitives.append(primitive) self.x, self.y = x, y def _evaluate_aperture(self, stmt): -- cgit