diff options
author | jaseg <git@jaseg.de> | 2021-12-30 23:40:06 +0100 |
---|---|---|
committer | jaseg <git@jaseg.de> | 2021-12-30 23:40:06 +0100 |
commit | ad87bb610f5d1b063fb5a8259d6aabbc6955b65e (patch) | |
tree | d4b8dd16f6dd7674e8aee5c92e35c7d3cf260f83 /gerbonara/gerber/aperture_macros/parse.py | |
parent | 9db91239ea0eac21f38435c1388f86f94f9ce8f3 (diff) | |
download | gerbonara-ad87bb610f5d1b063fb5a8259d6aabbc6955b65e.tar.gz gerbonara-ad87bb610f5d1b063fb5a8259d6aabbc6955b65e.tar.bz2 gerbonara-ad87bb610f5d1b063fb5a8259d6aabbc6955b65e.zip |
fix ALL the tests ^^
Diffstat (limited to 'gerbonara/gerber/aperture_macros/parse.py')
-rw-r--r-- | gerbonara/gerber/aperture_macros/parse.py | 19 |
1 files changed, 9 insertions, 10 deletions
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__': |