summaryrefslogtreecommitdiff
path: root/gerbonara/gerber/rs274x.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2022-01-18 01:10:16 +0100
committerjaseg <git@jaseg.de>2022-01-18 01:10:16 +0100
commitd85790bc6d40deb1d52cc5d8a4c178f664635625 (patch)
tree8be76c210974a2dbd1f11c5eecfee015c46f9d83 /gerbonara/gerber/rs274x.py
parent73a44901c0ef0e94e9465c2f35750ca6f85a4473 (diff)
downloadgerbonara-d85790bc6d40deb1d52cc5d8a4c178f664635625.tar.gz
gerbonara-d85790bc6d40deb1d52cc5d8a4c178f664635625.tar.bz2
gerbonara-d85790bc6d40deb1d52cc5d8a4c178f664635625.zip
Unit code refactor WIP
Diffstat (limited to 'gerbonara/gerber/rs274x.py')
-rw-r--r--gerbonara/gerber/rs274x.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/gerbonara/gerber/rs274x.py b/gerbonara/gerber/rs274x.py
index 4994c59..42d7f81 100644
--- a/gerbonara/gerber/rs274x.py
+++ b/gerbonara/gerber/rs274x.py
@@ -86,13 +86,13 @@ class GerberFile(CamFile):
(min_x, min_y), (max_x, max_y) = self.bounding_box(svg_unit, default=((0, 0), (0, 0)))
else:
(min_x, min_y), (max_x, max_y) = force_bounds
- min_x = arg_unit.to(svg_unit, min_x)
- min_y = arg_unit.to(svg_unit, min_y)
- max_x = arg_unit.to(svg_unit, max_x)
- max_y = arg_unit.to(svg_unit, max_y)
+ min_x = svg_unit(min_x, arg_unit)
+ min_y = svg_unit(min_y, arg_unit)
+ max_x = svg_unit(max_x, arg_unit)
+ max_y = svg_unit(max_y, arg_unit)
if margin:
- margin = arg_unit.to(svg_unit, margin)
+ margin = svg_unit(margin, arg_unit)
min_x -= margin
min_y -= margin
max_x += margin
@@ -444,7 +444,7 @@ class GraphicsState:
def update_point(self, x, y, unit=None):
old_point = self.point
- x, y = MM.from(unit, x), MM.from(unit, y)
+ x, y = MM(x, unit), MM(y, unit)
if x is None:
x = self.point[0]
@@ -466,7 +466,7 @@ class GraphicsState:
yield ApertureStmt(self.aperture_map[id(aperture)])
def set_current_point(self, point, unit=None):
- point_mm = MM.from(unit, point[0]), MM.from(unit, point[1])
+ point_mm = MM(point[0], unit), MM(point[1], unit)
# TODO calculate appropriate precision for math.isclose given file_settings.notation
if not points_close(self.point, point_mm):