summaryrefslogtreecommitdiff
path: root/gerber/cam.py
diff options
context:
space:
mode:
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)