summaryrefslogtreecommitdiff
path: root/gerber/cam.py
diff options
context:
space:
mode:
authorPaulo Henrique Silva <ph.silva@gmail.com>2016-11-16 23:54:09 -0200
committerGitHub <noreply@github.com>2016-11-16 23:54:09 -0200
commit521fe89150c6aaa0ff0954cc8d32e4b6f8009324 (patch)
tree59cef68f1449a5be8d2a9a8ed352e3d9974a3edb /gerber/cam.py
parent7030eee5e28180732c5cf98aeda4b66657223870 (diff)
parent1e868763a1c4030bedd51553468cbe25f272bef9 (diff)
downloadgerbonara-521fe89150c6aaa0ff0954cc8d32e4b6f8009324.tar.gz
gerbonara-521fe89150c6aaa0ff0954cc8d32e4b6f8009324.tar.bz2
gerbonara-521fe89150c6aaa0ff0954cc8d32e4b6f8009324.zip
Merge pull request #58 from garretfick/merge-curtacircuitos
Epic merge from @garretfick Thanks a lot @garretfick and @hamiltonkibbe.
Diffstat (limited to 'gerber/cam.py')
-rw-r--r--gerber/cam.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/gerber/cam.py b/gerber/cam.py
index 86312fb..15b801a 100644
--- a/gerber/cam.py
+++ b/gerber/cam.py
@@ -74,9 +74,10 @@ class FileSettings(object):
elif zero_suppression is not None:
if zero_suppression not in ['leading', 'trailing']:
- raise ValueError('Zero suppression must be either leading or \
- trailling')
- self.zero_suppression = zero_suppression
+ # This is a common problem in Eagle files, so just suppress it
+ self.zero_suppression = 'leading'
+ else:
+ self.zero_suppression = zero_suppression
elif zeros is not None:
if zeros not in ['leading', 'trailing']:
@@ -168,6 +169,10 @@ class FileSettings(object):
self.format == other.format and
self.angle_units == other.angle_units)
+ def __str__(self):
+ return ('<Settings: %s %s %s %s %s>' %
+ (self.units, self.notation, self.zero_suppression, self.format, self.angle_units))
+
class CamFile(object):
""" Base class for Gerber/Excellon files.
@@ -265,13 +270,13 @@ class CamFile(object):
if ctx is None:
from .render import GerberCairoContext
ctx = GerberCairoContext()
- ctx.set_bounds(self.bounds)
+ ctx.set_bounds(self.bounding_box)
ctx._paint_background()
ctx.invert = invert
ctx._new_render_layer()
for p in self.primitives:
ctx.render(p)
- ctx._paint()
+ ctx._flatten()
if filename is not None:
ctx.dump(filename)