summaryrefslogtreecommitdiff
path: root/gerber/cam.py
diff options
context:
space:
mode:
authorGarret Fick <garret@ficksworkshop.com>2016-07-17 10:42:03 +0800
committerGarret Fick <garret@ficksworkshop.com>2016-07-17 10:42:03 +0800
commit0dded38353e1d650458f6401aea37a4aadaf28ff (patch)
treea297c26c7cbb6b1c7d7a9cbe4eb4639b203fba53 /gerber/cam.py
parentd0e9018da0d7c51c2195f641c9189f85378df3e8 (diff)
parentd1598b46c91ee36719460d49d7ba2ed5ecd0ef45 (diff)
downloadgerbonara-0dded38353e1d650458f6401aea37a4aadaf28ff.tar.gz
gerbonara-0dded38353e1d650458f6401aea37a4aadaf28ff.tar.bz2
gerbonara-0dded38353e1d650458f6401aea37a4aadaf28ff.zip
Merge in negative soldermask. Still required further changes to support negatives for shapes that dont exist in the merge source
Diffstat (limited to 'gerber/cam.py')
-rw-r--r--gerber/cam.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/gerber/cam.py b/gerber/cam.py
index 8e31bf0..ae96474 100644
--- a/gerber/cam.py
+++ b/gerber/cam.py
@@ -248,7 +248,7 @@ class CamFile(object):
"""
pass
- def render(self, ctx, filename=None):
+ def render(self, ctx, invert=False, filename=None):
""" Generate image of layer.
Parameters
@@ -262,10 +262,14 @@ class CamFile(object):
ctx.set_bounds(self.bounds)
ctx._paint_background()
- if ctx.invert:
+ if invert:
+ ctx.invert = True
ctx._paint_inverted_layer()
-
for p in self.primitives:
ctx.render(p)
+ if invert:
+ ctx.invert = False
+ ctx._render_mask()
+
if filename is not None:
ctx.dump(filename)