summaryrefslogtreecommitdiff
path: root/gerber
diff options
context:
space:
mode:
Diffstat (limited to 'gerber')
-rw-r--r--gerber/primitives.py19
-rw-r--r--gerber/rs274x.py4
2 files changed, 21 insertions, 2 deletions
diff --git a/gerber/primitives.py b/gerber/primitives.py
index d74226d..a5c3055 100644
--- a/gerber/primitives.py
+++ b/gerber/primitives.py
@@ -795,9 +795,26 @@ class AMGroup(Primitive):
elif prim:
self.primitives.append(prim)
self._position = None
- self._to_convert = ['primitives']
+ self._to_convert = ['_position', 'primitives']
self.stmt = stmt
+ def to_inch(self):
+ if self.units == 'metric':
+ super(AMGroup, self).to_inch()
+
+ # If we also have a stmt, convert that too
+ if self.stmt:
+ self.stmt.to_inch()
+
+
+ def to_metric(self):
+ if self.units == 'inch':
+ super(AMGroup, self).to_metric()
+
+ # If we also have a stmt, convert that too
+ if self.stmt:
+ self.stmt.to_metric()
+
@property
def flashed(self):
return True
diff --git a/gerber/rs274x.py b/gerber/rs274x.py
index 86785bc..2bc8f9a 100644
--- a/gerber/rs274x.py
+++ b/gerber/rs274x.py
@@ -373,7 +373,9 @@ class GerberParser(object):
elif param["param"] == "AD":
yield ADParamStmt.from_dict(param)
elif param["param"] == "AM":
- yield AMParamStmt.from_dict(param)
+ stmt = AMParamStmt.from_dict(param)
+ stmt.units = self.settings.units
+ yield stmt
elif param["param"] == "OF":
yield OFParamStmt.from_dict(param)
elif param["param"] == "IN":