summaryrefslogtreecommitdiff
path: root/gerbonara/apertures.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2023-04-26 23:37:38 +0200
committerjaseg <git@jaseg.de>2023-04-26 23:37:38 +0200
commit958b47ab471053798ff55194c4aff4cf52f7602a (patch)
treec072350ff0a7a3db367fe9a236bd327761bd4141 /gerbonara/apertures.py
parent38f766dc42e3bec72236cc34c6b74fc4dab37c4e (diff)
downloadgerbonara-958b47ab471053798ff55194c4aff4cf52f7602a.tar.gz
gerbonara-958b47ab471053798ff55194c4aff4cf52f7602a.tar.bz2
gerbonara-958b47ab471053798ff55194c4aff4cf52f7602a.zip
Speed up protoboard generation
Diffstat (limited to 'gerbonara/apertures.py')
-rw-r--r--gerbonara/apertures.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/gerbonara/apertures.py b/gerbonara/apertures.py
index feccb7f..73a6e9c 100644
--- a/gerbonara/apertures.py
+++ b/gerbonara/apertures.py
@@ -20,7 +20,7 @@ import math
from dataclasses import dataclass, replace, field, fields, InitVar
from .aperture_macros.parse import GenericMacros
-from .utils import MM, Inch
+from .utils import MM, Inch, sum_bounds
from . import graphic_primitives as gp
@@ -118,6 +118,9 @@ class Aperture:
"""
return self._primitives(x, y, unit, polarity_dark)
+ def bounding_box(self, unit=None):
+ return sum_bounds((prim.bounding_box() for prim in self.flash(0, 0, unit, True)))
+
def equivalent_width(self, unit=None):
""" Get the width of a line interpolated using this aperture in the given :py:class:`~.LengthUnit`.