summaryrefslogtreecommitdiff
path: root/gerbonara/graphic_objects.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2023-04-20 00:46:30 +0200
committerjaseg <git@jaseg.de>2023-04-20 00:46:30 +0200
commit5ce88e4d1b06dcc846c94ec614fb00f64e85c125 (patch)
tree30cacf1ffb500c1deebc6b30e8c98d7ec474559a /gerbonara/graphic_objects.py
parent240e5569aa7521aed321b2607f78d198c36ed8b8 (diff)
downloadgerbonara-5ce88e4d1b06dcc846c94ec614fb00f64e85c125.tar.gz
gerbonara-5ce88e4d1b06dcc846c94ec614fb00f64e85c125.tar.bz2
gerbonara-5ce88e4d1b06dcc846c94ec614fb00f64e85c125.zip
Fix a bunch of bugs on the way to electroniceel's protoboard layout
Diffstat (limited to 'gerbonara/graphic_objects.py')
-rw-r--r--gerbonara/graphic_objects.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/gerbonara/graphic_objects.py b/gerbonara/graphic_objects.py
index 79acd13..0d28045 100644
--- a/gerbonara/graphic_objects.py
+++ b/gerbonara/graphic_objects.py
@@ -370,7 +370,7 @@ class Region(GraphicObject):
if points[-1] != points[0]:
points.append(points[0])
- yield amp.Outline(self.unit, int(self.polarity_dark), len(points)-1, *(coord for p in points for coord in p))
+ yield amp.Outline(self.unit, [int(self.polarity_dark), len(points)-1, *(coord for p in points for coord in p)])
def to_primitives(self, unit=None):
if unit == self.unit:
@@ -499,9 +499,10 @@ class Line(GraphicObject):
def _aperture_macro_primitives(self):
obj = self.converted(MM) # Gerbonara aperture macros use MM units.
- yield amp.VectorLine(int(self.polarity_dark), obj.width, obj.x1, obj.y1, obj.x2, obj.y2)
- yield amp.Circle(int(self.polarity_dark), obj.width, obj.x1, obj.y1)
- yield amp.Circle(int(self.polarity_dark), obj.width, obj.x2, obj.y2)
+ width = obj.aperture.equivalent_width(MM)
+ yield amp.VectorLine(MM, [int(self.polarity_dark), width, obj.x1, obj.y1, obj.x2, obj.y2, 0])
+ yield amp.Circle(MM, [int(self.polarity_dark), width, obj.x1, obj.y1])
+ yield amp.Circle(MM, [int(self.polarity_dark), width, obj.x2, obj.y2])
def to_statements(self, gs):
yield from gs.set_polarity(self.polarity_dark)