summaryrefslogtreecommitdiff
path: root/gerber/rs274x.py
diff options
context:
space:
mode:
authorHamilton Kibbe <hamilton.kibbe@gmail.com>2016-01-21 03:57:44 -0500
committerGarret Fick <garret@ficksworkshop.com>2016-09-24 02:28:36 +0800
commit5af19af190c1fb0f0c5be029d46d63e657dde4d9 (patch)
treedd60a0b21e1d1ca7258b9f978ce973354d96062c /gerber/rs274x.py
parent8d5e782ccf220d77f0aad5a4e5605dc5cbe0f410 (diff)
downloadgerbonara-5af19af190c1fb0f0c5be029d46d63e657dde4d9.tar.gz
gerbonara-5af19af190c1fb0f0c5be029d46d63e657dde4d9.tar.bz2
gerbonara-5af19af190c1fb0f0c5be029d46d63e657dde4d9.zip
Commit partial merge so I can work on the plane
Diffstat (limited to 'gerber/rs274x.py')
-rw-r--r--gerber/rs274x.py22
1 files changed, 17 insertions, 5 deletions
diff --git a/gerber/rs274x.py b/gerber/rs274x.py
index 7fec64f..e84c161 100644
--- a/gerber/rs274x.py
+++ b/gerber/rs274x.py
@@ -95,6 +95,7 @@ class GerberFile(CamFile):
`bounds` is stored as ((min x, max x), (min y, max y))
"""
+
def __init__(self, statements, settings, primitives, apertures, filename=None):
super(GerberFile, self).__init__(statements, settings, primitives, filename)
@@ -568,7 +569,7 @@ class GerberParser(object):
self.interpolation = 'arc'
self.direction = ('clockwise' if stmt.function in
('G02', 'G2') else 'counterclockwise')
-
+
if stmt.only_function:
# Sometimes we get a coordinate statement
# that only sets the function. If so, don't
@@ -594,7 +595,6 @@ class GerberParser(object):
else:
# from gerber spec revision J3, Section 4.5, page 55:
# The segments are not graphics objects in themselves; segments are part of region which is the graphics object. The segments have no thickness.
-
# The current aperture is associated with the region.
# This has no graphical effect, but allows all its attributes to
# be applied to the region.
@@ -616,12 +616,24 @@ class GerberParser(object):
j = 0 if stmt.j is None else stmt.j
center = self._find_center(start, end, (i, j))
if self.region_mode == 'off':
- self.primitives.append(Arc(start, end, center, self.direction, self.apertures[self.aperture], quadrant_mode=self.quadrant_mode, level_polarity=self.level_polarity, units=self.settings.units))
+ self.primitives.append(Arc(start, end, center, self.direction,
+ self.apertures[self.aperture],
+ quadrant_mode=self.quadrant_mode,
+ level_polarity=self.level_polarity,
+ units=self.settings.units))
else:
if self.current_region is None:
- self.current_region = [Arc(start, end, center, self.direction, self.apertures.get(self.aperture, Circle((0,0), 0)), quadrant_mode=self.quadrant_mode, level_polarity=self.level_polarity, units=self.settings.units),]
+ self.current_region = [Arc(start, end, center, self.direction,
+ self.apertures.get(self.aperture, Circle((0,0), 0)),
+ quadrant_mode=self.quadrant_mode,
+ level_polarity=self.level_polarity,
+ units=self.settings.units),]
else:
- self.current_region.append(Arc(start, end, center, self.direction, self.apertures.get(self.aperture, Circle((0,0), 0)), quadrant_mode=self.quadrant_mode, level_polarity=self.level_polarity, units=self.settings.units))
+ self.current_region.append(Arc(start, end, center, self.direction,
+ self.apertures.get(self.aperture, Circle((0,0), 0)),
+ quadrant_mode=self.quadrant_mode,
+ level_polarity=self.level_polarity,
+ units=self.settings.units))
elif self.op == "D02" or self.op == "D2":