From 11325b213b6ef7cebcdcf0c79f966cda3ce61a89 Mon Sep 17 00:00:00 2001 From: jaseg Date: Thu, 9 Nov 2023 20:08:26 +0100 Subject: 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. --- gerbonara/apertures.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gerbonara/apertures.py') 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) - -- cgit