From ad87bb610f5d1b063fb5a8259d6aabbc6955b65e Mon Sep 17 00:00:00 2001 From: jaseg Date: Thu, 30 Dec 2021 23:40:06 +0100 Subject: fix ALL the tests ^^ --- gerbonara/gerber/aperture_macros/parse.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'gerbonara/gerber/aperture_macros') diff --git a/gerbonara/gerber/aperture_macros/parse.py b/gerbonara/gerber/aperture_macros/parse.py index 6eed381..86f2882 100644 --- a/gerbonara/gerber/aperture_macros/parse.py +++ b/gerbonara/gerber/aperture_macros/parse.py @@ -127,30 +127,29 @@ deg_per_rad = 180 / math.pi class GenericMacros: _generic_hole = lambda n: [ - ap.Circle(None, [0, var(n), 0, 0]), - ap.CenterLine(None, [0, var(n), var(n+1), 0, 0, var(n+2) * -deg_per_rad])] + ap.Circle('mm', [0, var(n), 0, 0]), + ap.CenterLine('mm', [0, var(n), var(n+1), 0, 0, var(n+2) * -deg_per_rad])] - # Initialize all these with "None" units so they inherit file units, and do not convert their arguments. # NOTE: All generic macros have rotation values specified in **clockwise radians** like the rest of the user-facing # API. circle = ApertureMacro('GNC', [ - ap.Circle(None, [1, var(1), 0, 0, var(4) * -deg_per_rad]), + ap.Circle('mm', [1, var(1), 0, 0, var(4) * -deg_per_rad]), *_generic_hole(2)]) rect = ApertureMacro('GNR', [ - ap.CenterLine(None, [1, var(1), var(2), 0, 0, var(5) * -deg_per_rad]), + ap.CenterLine('mm', [1, var(1), var(2), 0, 0, var(5) * -deg_per_rad]), *_generic_hole(3) ]) # w must be larger than h obround = ApertureMacro('GNO', [ - ap.CenterLine(None, [1, var(1), var(2), 0, 0, var(5) * -deg_per_rad]), - ap.Circle(None, [1, var(2), +var(1)/2, 0, var(5) * -deg_per_rad]), - ap.Circle(None, [1, var(2), -var(1)/2, 0, var(5) * -deg_per_rad]), + ap.CenterLine('mm', [1, var(1), var(2), 0, 0, var(5) * -deg_per_rad]), + ap.Circle('mm', [1, var(2), +var(1)/2, 0, var(5) * -deg_per_rad]), + ap.Circle('mm', [1, var(2), -var(1)/2, 0, var(5) * -deg_per_rad]), *_generic_hole(3) ]) polygon = ApertureMacro('GNP', [ - ap.Polygon(None, [1, var(2), 0, 0, var(1), var(3) * -deg_per_rad]), - ap.Circle(None, [0, var(4), 0, 0])]) + ap.Polygon('mm', [1, var(2), 0, 0, var(1), var(3) * -deg_per_rad]), + ap.Circle('mm', [0, var(4), 0, 0])]) if __name__ == '__main__': -- cgit