summaryrefslogtreecommitdiff
path: root/gerber/cam.py
diff options
context:
space:
mode:
authorPaulo Henrique Silva <ph.silva@gmail.com>2015-12-20 22:15:44 -0200
committerPaulo Henrique Silva <ph.silva@gmail.com>2015-12-20 22:15:44 -0200
commitd1598b46c91ee36719460d49d7ba2ed5ecd0ef45 (patch)
tree7e107cc196fade05719f0cc6a659f6f17f6a3b3b /gerber/cam.py
parent2e2b4e49c3182cc7385f12d760222ecb57cc1356 (diff)
parent163a0cd531c667ec666108562eb2dbec28ce6125 (diff)
downloadgerbonara-d1598b46c91ee36719460d49d7ba2ed5ecd0ef45.tar.gz
gerbonara-d1598b46c91ee36719460d49d7ba2ed5ecd0ef45.tar.bz2
gerbonara-d1598b46c91ee36719460d49d7ba2ed5ecd0ef45.zip
Merge pull request #52 from curtacircuitos/negative_soldermask
Allow negative solder mask rendering per #50.
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 c567055..cf06ec9 100644
--- a/gerber/cam.py
+++ b/gerber/cam.py
@@ -243,7 +243,7 @@ class CamFile(object):
"""
pass
- def render(self, ctx, filename=None):
+ def render(self, ctx, invert=False, filename=None):
""" Generate image of layer.
Parameters
@@ -256,10 +256,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)