diff options
author | jaseg <git@jaseg.de> | 2023-11-09 20:08:26 +0100 |
---|---|---|
committer | jaseg <git@jaseg.de> | 2023-11-14 21:52:12 +0100 |
commit | 11325b213b6ef7cebcdcf0c79f966cda3ce61a89 (patch) | |
tree | 90922e50e32b30fb1d7431de9e48d8b5aa5e51ad /gerbonara/apertures.py | |
parent | 74fb384c4c0899f4d6f153da8db748a7a49e78ee (diff) | |
download | gerbonara-11325b213b6ef7cebcdcf0c79f966cda3ce61a89.tar.gz gerbonara-11325b213b6ef7cebcdcf0c79f966cda3ce61a89.tar.bz2 gerbonara-11325b213b6ef7cebcdcf0c79f966cda3ce61a89.zip |
Calculate out all aperture macros by default.
There are just too many severely buggy implementations around. Today I
ran into problems with both gerbv and with whatever JLC uses. You can
still export macros with raw expressions by setting a flag in the export
FileSettings.
Diffstat (limited to 'gerbonara/apertures.py')
-rw-r--r-- | gerbonara/apertures.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gerbonara/apertures.py b/gerbonara/apertures.py index 09b15d2..f057052 100644 --- a/gerbonara/apertures.py +++ b/gerbonara/apertures.py @@ -446,6 +446,11 @@ class ApertureMacroInstance(Aperture): def scaled(self, scale): return replace(self, macro=self.macro.scaled(scale)) + def calculate_out(self, unit=None, macro_name=None): + return replace(self, + parameters=tuple(), + macro=self.macro.substitute_params(self._params(unit), unit, macro_name)) + def _params(self, unit=None): # We ignore "unit" here as we convert the actual macro, not this instantiation. # We do this because here we do not have information about which parameter has which physical units. @@ -455,4 +460,3 @@ class ApertureMacroInstance(Aperture): parameters = parameters[:self.macro.num_parameters] return tuple(parameters) - |