diff options
author | Garret Fick <garret@ficksworkshop.com> | 2016-07-24 22:08:31 +0800 |
---|---|---|
committer | Garret Fick <garret@ficksworkshop.com> | 2016-07-24 22:08:31 +0800 |
commit | 965d3ce23b92f8aff1063debd6d3364de15791fe (patch) | |
tree | 304ac755578479554ed812da87c782e9f6772582 /gerber/rs274x.py | |
parent | 7cd6acf12670f3773113f67ed2acb35cb21c32a0 (diff) | |
download | gerbonara-965d3ce23b92f8aff1063debd6d3364de15791fe.tar.gz gerbonara-965d3ce23b92f8aff1063debd6d3364de15791fe.tar.bz2 gerbonara-965d3ce23b92f8aff1063debd6d3364de15791fe.zip |
Add more tests for rendering to PNG. Start adding tests for rendering to Gerber format. Changed definition of no hole to use None instead of 0 so we can differentiate when writing to Gerber format. Makde polygon use hole diameter instead of hole radius to match other primitives
Diffstat (limited to 'gerber/rs274x.py')
-rw-r--r-- | gerber/rs274x.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gerber/rs274x.py b/gerber/rs274x.py index e88bba7..f009232 100644 --- a/gerber/rs274x.py +++ b/gerber/rs274x.py @@ -486,7 +486,7 @@ class GerberParser(object): if len(modifiers[0]) >= 2: hole_diameter = modifiers[0][1] else: - hole_diameter = 0 + hole_diameter = None aperture = Circle(position=None, diameter=diameter, hole_diameter=hole_diameter, units=self.settings.units) elif shape == 'R': @@ -496,7 +496,7 @@ class GerberParser(object): if len(modifiers[0]) >= 3: hole_diameter = modifiers[0][2] else: - hole_diameter = 0 + hole_diameter = None aperture = Rectangle(position=None, width=width, height=height, hole_diameter=hole_diameter, units=self.settings.units) elif shape == 'O': @@ -506,7 +506,7 @@ class GerberParser(object): if len(modifiers[0]) >= 3: hole_diameter = modifiers[0][2] else: - hole_diameter = 0 + hole_diameter = None aperture = Obround(position=None, width=width, height=height, hole_diameter=hole_diameter, units=self.settings.units) elif shape == 'P': @@ -520,8 +520,8 @@ class GerberParser(object): if len(modifiers[0]) > 3: hole_diameter = modifiers[0][3] else: - hole_diameter = 0 - aperture = Polygon(position=None, sides=number_vertices, radius=outer_diameter/2.0, hole_radius=hole_diameter/2.0, rotation=rotation) + hole_diameter = None + aperture = Polygon(position=None, sides=number_vertices, radius=outer_diameter/2.0, hole_diameter=hole_diameter, rotation=rotation) else: aperture = self.macros[shape].build(modifiers) |