diff options
author | Garret Fick <garret@ficksworkshop.com> | 2016-07-24 17:08:47 +0800 |
---|---|---|
committer | Garret Fick <garret@ficksworkshop.com> | 2016-07-24 17:08:47 +0800 |
commit | 7cd6acf12670f3773113f67ed2acb35cb21c32a0 (patch) | |
tree | ce2d79376375b8c7b4ee8c0f519f23d3f3fc1db9 /gerber/render/rs274x_backend.py | |
parent | cd4614f9973eb9f4ce858b3864573367614f54b6 (diff) | |
download | gerbonara-7cd6acf12670f3773113f67ed2acb35cb21c32a0.tar.gz gerbonara-7cd6acf12670f3773113f67ed2acb35cb21c32a0.tar.bz2 gerbonara-7cd6acf12670f3773113f67ed2acb35cb21c32a0.zip |
Add many render tests based on the Umaco gerger specification. Fix multiple rendering bugs, especially related to holes in flashed apertures
Diffstat (limited to 'gerber/render/rs274x_backend.py')
-rw-r--r-- | gerber/render/rs274x_backend.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gerber/render/rs274x_backend.py b/gerber/render/rs274x_backend.py index 972edcb..15e9154 100644 --- a/gerber/render/rs274x_backend.py +++ b/gerber/render/rs274x_backend.py @@ -151,7 +151,7 @@ class Rs274xContext(GerberContext): # Select the right aperture if not already selected if aperture: if isinstance(aperture, Circle): - aper = self._get_circle(aperture.diameter) + aper = self._get_circle(aperture.diameter, aperture.hole_diameter) elif isinstance(aperture, Rectangle): aper = self._get_rectangle(aperture.width, aperture.height) elif isinstance(aperture, Obround): @@ -275,10 +275,10 @@ class Rs274xContext(GerberContext): self._pos = primitive.position - def _get_circle(self, diameter, dcode = None): + def _get_circle(self, diameter, hole_diameter, dcode = None): '''Define a circlar aperture''' - aper = self._circles.get(diameter, None) + aper = self._circles.get((diameter, hole_diameter), None) if not aper: if not dcode: @@ -287,15 +287,15 @@ class Rs274xContext(GerberContext): else: self._next_dcode = max(dcode + 1, self._next_dcode) - aper = ADParamStmt.circle(dcode, diameter) - self._circles[diameter] = aper + aper = ADParamStmt.circle(dcode, diameter, hole_diameter) + self._circles[(diameter, hole_diameter)] = aper self.header.append(aper) return aper def _render_circle(self, circle, color): - aper = self._get_circle(circle.diameter) + aper = self._get_circle(circle.diameter, circle.hole_diameter) self._render_flash(circle, aper) def _get_rectangle(self, width, height, dcode = None): |