summaryrefslogtreecommitdiff
path: root/gerbonara/gerber/gerber_statements.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/gerber_statements.py
parent336a18fb493c79824323a59865083a0037a4a2f4 (diff)
downloadgerbonara-73a44901c0ef0e94e9465c2f35750ca6f85a4473.tar.gz
gerbonara-73a44901c0ef0e94e9465c2f35750ca6f85a4473.tar.bz2
gerbonara-73a44901c0ef0e94e9465c2f35750ca6f85a4473.zip
Excellon, unit conversion WIP
Diffstat (limited to 'gerbonara/gerber/gerber_statements.py')
-rw-r--r--gerbonara/gerber/gerber_statements.py10
1 files changed, 1 insertions, 9 deletions
diff --git a/gerbonara/gerber/gerber_statements.py b/gerbonara/gerber/gerber_statements.py
index c2f1934..7c9a301 100644
--- a/gerbonara/gerber/gerber_statements.py
+++ b/gerbonara/gerber/gerber_statements.py
@@ -23,14 +23,6 @@ Gerber (RS-274X) Statements
# FIXME make this entire file obsolete and just return strings from graphical objects directly instead
-def convert(value, src, dst):
- if src == dst or src is None or dst is None or value is None:
- return value
- elif dst == 'mm':
- return value * 25.4
- else:
- return value / 25.4
-
class Statement:
pass
@@ -128,7 +120,7 @@ class CoordStmt(Statement):
def to_gerber(self, settings=None):
ret = ''
for var in 'xyij':
- val = convert(getattr(self, var), self.unit, settings.unit)
+ val = self.unit.to(settings.unit, getattr(self, var))
if val is not None:
ret += var.upper() + settings.write_gerber_value(val)
return ret + self.code + '*'