summaryrefslogtreecommitdiff
path: root/gerber/cam.py
diff options
context:
space:
mode:
authorHamilton Kibbe <hamilton.kibbe@gmail.com>2016-01-28 12:19:03 -0500
committerHamilton Kibbe <hamilton.kibbe@gmail.com>2016-01-28 12:19:03 -0500
commit5df38c014fd09792995b2b12b1982c535c962c9a (patch)
tree3dd1f118a752b7b6e75511e1f3b3af3ac1b67bdc /gerber/cam.py
parentb9f1b106c3006f1dddb1279ae9622630a29d18c7 (diff)
downloadgerbonara-5df38c014fd09792995b2b12b1982c535c962c9a.tar.gz
gerbonara-5df38c014fd09792995b2b12b1982c535c962c9a.tar.bz2
gerbonara-5df38c014fd09792995b2b12b1982c535c962c9a.zip
Cleanup, rendering fixes.
fixed rendering of tented vias fixed rendering of semi-transparent layers fixed file type detection issues added some examples
Diffstat (limited to 'gerber/cam.py')
-rw-r--r--gerber/cam.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/gerber/cam.py b/gerber/cam.py
index dda5c10..86312fb 100644
--- a/gerber/cam.py
+++ b/gerber/cam.py
@@ -251,7 +251,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
@@ -262,13 +262,16 @@ class CamFile(object):
filename : string <optional>
If provided, save the rendered image to `filename`
"""
+ if ctx is None:
+ from .render import GerberCairoContext
+ ctx = GerberCairoContext()
ctx.set_bounds(self.bounds)
ctx._paint_background()
ctx.invert = invert
ctx._new_render_layer()
for p in self.primitives:
ctx.render(p)
- ctx._flatten()
+ ctx._paint()
if filename is not None:
ctx.dump(filename)