diff options
author | jaseg <git@jaseg.net> | 2017-11-25 16:14:23 +0100 |
---|---|---|
committer | jaseg <git@jaseg.net> | 2017-11-25 16:14:23 +0100 |
commit | b87629c2ae648aef019284aeca7366698ca0903f (patch) | |
tree | 76ae404d1cb9f986ce48fa9a2733d543def7ac0d | |
parent | fa9f2c3a74125ef69034a1fac905b9ded6b2ff5d (diff) | |
download | gerbonara-b87629c2ae648aef019284aeca7366698ca0903f.tar.gz gerbonara-b87629c2ae648aef019284aeca7366698ca0903f.tar.bz2 gerbonara-b87629c2ae648aef019284aeca7366698ca0903f.zip |
Add hole support to ADParamStmt.rect
-rw-r--r-- | gerber/gerber_statements.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gerber/gerber_statements.py b/gerber/gerber_statements.py index 43596be..339b02a 100644 --- a/gerber/gerber_statements.py +++ b/gerber/gerber_statements.py @@ -274,14 +274,18 @@ class ADParamStmt(ParamStmt): """ @classmethod - def rect(cls, dcode, width, height): + def rect(cls, dcode, width, height, hole_diameter=None, hole_width=None, hole_height=None): '''Create a rectangular aperture definition statement''' + if hole_diameter is not None and hole_diameter > 0: + return cls('AD', dcode, 'R', ([width, height, hole_diameter],)) + elif (hole_width is not None and hole_width > 0 + and hole_height is not None and hole_height > 0): + return cls('AD', dcode, 'R', ([width, height, hole_width, hole_height],)) return cls('AD', dcode, 'R', ([width, height],)) @classmethod def circle(cls, dcode, diameter, hole_diameter=None, hole_width=None, hole_height=None): '''Create a circular aperture definition statement''' - if hole_diameter is not None and hole_diameter > 0: return cls('AD', dcode, 'C', ([diameter, hole_diameter],)) elif (hole_width is not None and hole_width > 0 |