summaryrefslogtreecommitdiff
path: root/gerbonara/gerber/aperture_macros/expression.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2022-01-17 23:14:52 +0100
committerjaseg <git@jaseg.de>2022-01-17 23:14:52 +0100
commit73a44901c0ef0e94e9465c2f35750ca6f85a4473 (patch)
treea5c66526a38fe5a4e3d004dc7127680b6d0e25c6 /gerbonara/gerber/aperture_macros/expression.py
parent336a18fb493c79824323a59865083a0037a4a2f4 (diff)
downloadgerbonara-73a44901c0ef0e94e9465c2f35750ca6f85a4473.tar.gz
gerbonara-73a44901c0ef0e94e9465c2f35750ca6f85a4473.tar.bz2
gerbonara-73a44901c0ef0e94e9465c2f35750ca6f85a4473.zip
Excellon, unit conversion WIP
Diffstat (limited to 'gerbonara/gerber/aperture_macros/expression.py')
-rw-r--r--gerbonara/gerber/aperture_macros/expression.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/gerbonara/gerber/aperture_macros/expression.py b/gerbonara/gerber/aperture_macros/expression.py
index fb399d3..2375c56 100644
--- a/gerbonara/gerber/aperture_macros/expression.py
+++ b/gerbonara/gerber/aperture_macros/expression.py
@@ -7,8 +7,7 @@ import operator
import re
import ast
-
-MILLIMETERS_PER_INCH = 25.4
+from ..utils import MM, Inch, MILLIMETERS_PER_INCH
def expr(obj):
@@ -81,10 +80,10 @@ class UnitExpression(Expression):
if self.unit is None or unit is None or self.unit == unit:
return self._expr
- elif unit == 'mm':
+ elif unit == MM:
return self._expr * MILLIMETERS_PER_INCH
- elif unit == 'inch':
+ elif unit == Inch:
return self._expr / MILLIMETERS_PER_INCH
else: