summaryrefslogtreecommitdiff
path: root/gerber/cam.py
diff options
context:
space:
mode:
authorGarret Fick <garret@fickworkshop.com>2016-11-11 15:54:42 +0800
committerGitHub <noreply@github.com>2016-11-11 15:54:42 +0800
commit1e868763a1c4030bedd51553468cbe25f272bef9 (patch)
tree59cef68f1449a5be8d2a9a8ed352e3d9974a3edb /gerber/cam.py
parent5af19af190c1fb0f0c5be029d46d63e657dde4d9 (diff)
parent60d08dc8ad72f5bb0a14d4821451d7dce20b9639 (diff)
downloadgerbonara-1e868763a1c4030bedd51553468cbe25f272bef9.tar.gz
gerbonara-1e868763a1c4030bedd51553468cbe25f272bef9.tar.bz2
gerbonara-1e868763a1c4030bedd51553468cbe25f272bef9.zip
Merge pull request #5 from hamiltonkibbe/merge-curtacircuitos
Merge curtacircuitos
Diffstat (limited to 'gerber/cam.py')
-rw-r--r--gerber/cam.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/gerber/cam.py b/gerber/cam.py
index c5b8938..15b801a 100644
--- a/gerber/cam.py
+++ b/gerber/cam.py
@@ -168,7 +168,7 @@ class FileSettings(object):
self.zero_suppression == other.zero_suppression and
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))
@@ -256,7 +256,7 @@ class CamFile(object):
def to_metric(self):
pass
- def render(self, ctx, invert=False, filename=None):
+ def render(self, ctx=None, invert=False, filename=None):
""" Generate image of layer.
Parameters
@@ -267,7 +267,10 @@ class CamFile(object):
filename : string <optional>
If provided, save the rendered image to `filename`
"""
- ctx.set_bounds(self.bounds)
+ if ctx is None:
+ from .render import GerberCairoContext
+ ctx = GerberCairoContext()
+ ctx.set_bounds(self.bounding_box)
ctx._paint_background()
ctx.invert = invert
ctx._new_render_layer()