summaryrefslogtreecommitdiff
path: root/gerbonara/gerber/cam.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2022-01-16 21:59:24 +0100
committerjaseg <git@jaseg.de>2022-01-16 21:59:24 +0100
commit336a18fb493c79824323a59865083a0037a4a2f4 (patch)
tree3e1e0db5f821cf52c32f70a4b38fac77c5a99c8c /gerbonara/gerber/cam.py
parentd644661fb04d40a3e95dd604f8cc13641bab263b (diff)
downloadgerbonara-336a18fb493c79824323a59865083a0037a4a2f4.tar.gz
gerbonara-336a18fb493c79824323a59865083a0037a4a2f4.tar.bz2
gerbonara-336a18fb493c79824323a59865083a0037a4a2f4.zip
Excellon WIP
Diffstat (limited to 'gerbonara/gerber/cam.py')
-rw-r--r--gerbonara/gerber/cam.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/gerbonara/gerber/cam.py b/gerbonara/gerber/cam.py
index 12906a0..f42c24d 100644
--- a/gerbonara/gerber/cam.py
+++ b/gerbonara/gerber/cam.py
@@ -92,8 +92,11 @@ class FileSettings:
else: # no or trailing zero suppression
return float(sign + value[:integer_digits] + '.' + value[integer_digits:])
- def write_gerber_value(self, value):
+ def write_gerber_value(self, value, unit=None):
""" Convert a floating point number to a Gerber/Excellon-formatted string. """
+
+ if unit is not None:
+ value = self.unit.from(unit, value)
integer_digits, decimal_digits = self.number_format