summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarret Fick <garret@ficksworkshop.com>2016-02-14 22:06:32 +0800
committerGarret Fick <garret@ficksworkshop.com>2016-02-14 22:06:32 +0800
commita765f8aa2c980cdbd6666f32f5be62c88118c152 (patch)
tree7ee8731053542ee41964aee6c50c4cb6373e2360
parent5b93db47cd29e384ead918db1893f4cf58326f82 (diff)
downloadgerbonara-a765f8aa2c980cdbd6666f32f5be62c88118c152.tar.gz
gerbonara-a765f8aa2c980cdbd6666f32f5be62c88118c152.tar.bz2
gerbonara-a765f8aa2c980cdbd6666f32f5be62c88118c152.zip
Fix convertion of units for apertures and regions
-rw-r--r--gerber/rs274x.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/gerber/rs274x.py b/gerber/rs274x.py
index bac5114..185cbc3 100644
--- a/gerber/rs274x.py
+++ b/gerber/rs274x.py
@@ -418,15 +418,15 @@ class GerberParser(object):
aperture = None
if shape == 'C':
diameter = modifiers[0][0]
- aperture = Circle(position=None, diameter=diameter)
+ aperture = Circle(position=None, diameter=diameter, units=self.settings.units)
elif shape == 'R':
width = modifiers[0][0]
height = modifiers[0][1]
- aperture = Rectangle(position=None, width=width, height=height)
+ aperture = Rectangle(position=None, width=width, height=height, units=self.settings.units)
elif shape == 'O':
width = modifiers[0][0]
height = modifiers[0][1]
- aperture = Obround(position=None, width=width, height=height)
+ aperture = Obround(position=None, width=width, height=height, units=self.settings.units)
elif shape == 'P':
# FIXME: not supported yet?
pass
@@ -438,7 +438,7 @@ class GerberParser(object):
def _evaluate_mode(self, stmt):
if stmt.type == 'RegionMode':
if self.region_mode == 'on' and stmt.mode == 'off':
- self.primitives.append(Region(self.current_region, level_polarity=self.level_polarity))
+ self.primitives.append(Region(self.current_region, level_polarity=self.level_polarity, units=self.settings.units))
self.current_region = None
self.region_mode = stmt.mode
elif stmt.type == 'QuadrantMode':