From 958b47ab471053798ff55194c4aff4cf52f7602a Mon Sep 17 00:00:00 2001 From: jaseg Date: Wed, 26 Apr 2023 23:37:38 +0200 Subject: Speed up protoboard generation --- gerbonara/apertures.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gerbonara/apertures.py') 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`. -- cgit