summaryrefslogtreecommitdiff
path: root/gerbonara/gerber/graphic_objects.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2022-01-09 19:59:15 +0100
committerjaseg <git@jaseg.de>2022-01-09 19:59:15 +0100
commit4d77937f01e4a7561f412a07e1e2c5a5dba0fc49 (patch)
tree5f9d0ab2fb8cd7f57ca17dd8abb107b39d40c52b /gerbonara/gerber/graphic_objects.py
parentd6f0f0cff4fa56af7754a12c87fb6bc10e212422 (diff)
downloadgerbonara-4d77937f01e4a7561f412a07e1e2c5a5dba0fc49.tar.gz
gerbonara-4d77937f01e4a7561f412a07e1e2c5a5dba0fc49.tar.bz2
gerbonara-4d77937f01e4a7561f412a07e1e2c5a5dba0fc49.zip
Make bounding box tests pass
Diffstat (limited to 'gerbonara/gerber/graphic_objects.py')
-rw-r--r--gerbonara/gerber/graphic_objects.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/gerbonara/gerber/graphic_objects.py b/gerbonara/gerber/graphic_objects.py
index 278401c..82aac67 100644
--- a/gerbonara/gerber/graphic_objects.py
+++ b/gerbonara/gerber/graphic_objects.py
@@ -43,7 +43,7 @@ class GerberObject:
self._rotate(rotation, cx, cy)
def bounding_box(self, unit=None):
- bboxes = [ p.bounding_box for p in self.to_primitives(unit) ]
+ bboxes = [ p.bounding_box() for p in self.to_primitives(unit) ]
min_x = min(min_x for (min_x, _min_y), _ in bboxes)
min_y = min(min_y for (_min_x, min_y), _ in bboxes)
max_x = max(max_x for _, (max_x, _max_y) in bboxes)
@@ -237,6 +237,7 @@ class Arc(GerberObject):
y1 : Length(float)
x2 : Length(float)
y2 : Length(float)
+ # relative to (x1, x2)
cx : Length(float)
cy : Length(float)
clockwise : bool
@@ -268,7 +269,7 @@ class Arc(GerberObject):
conv = self.converted(unit)
yield gp.Arc(x1=conv.x1, y1=conv.y1,
x2=conv.x2, y2=conv.y2,
- cx=conv.cx, cy=conv.cy,
+ cx=conv.cx+conv.x1, cy=conv.cy+conv.y1,
clockwise=self.clockwise,
width=self.aperture.equivalent_width(unit),
polarity_dark=self.polarity_dark)