From f2b075e338fcd103a7af6e20e27f3960e63d20e4 Mon Sep 17 00:00:00 2001 From: Garret Fick Date: Wed, 18 Nov 2015 11:26:20 +0800 Subject: Regions with arcs would crash if they occured before any command to set the aperture --- gerber/rs274x.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gerber/rs274x.py b/gerber/rs274x.py index 9fd63da..96bd136 100644 --- a/gerber/rs274x.py +++ b/gerber/rs274x.py @@ -498,9 +498,9 @@ class GerberParser(object): self.primitives.append(Arc(start, end, center, self.direction, self.apertures[self.aperture], level_polarity=self.level_polarity, units=self.settings.units)) else: if self.current_region is None: - self.current_region = [Arc(start, end, center, self.direction, self.apertures[self.aperture], level_polarity=self.level_polarity, units=self.settings.units),] + self.current_region = [Arc(start, end, center, self.direction, self.apertures.get(self.aperture, Circle((0,0), 0)), level_polarity=self.level_polarity, units=self.settings.units),] else: - self.current_region.append(Arc(start, end, center, self.direction, self.apertures[self.aperture], level_polarity=self.level_polarity, units=self.settings.units)) + self.current_region.append(Arc(start, end, center, self.direction, self.apertures.get(self.aperture, Circle((0,0), 0)), level_polarity=self.level_polarity, units=self.settings.units)) elif self.op == "D02": pass -- cgit