diff options
author | Hamilton Kibbe <hamilton.kibbe@gmail.com> | 2015-12-19 21:54:29 -0500 |
---|---|---|
committer | Hamilton Kibbe <hamilton.kibbe@gmail.com> | 2015-12-19 21:54:29 -0500 |
commit | 1cb269131bc52f0b1a1e69cef0466f2d994d52a8 (patch) | |
tree | 25555820946f2d7a7eac9b242bb160a883e8b0ad /gerber/cam.py | |
parent | 2e2b4e49c3182cc7385f12d760222ecb57cc1356 (diff) | |
download | gerbonara-1cb269131bc52f0b1a1e69cef0466f2d994d52a8.tar.gz gerbonara-1cb269131bc52f0b1a1e69cef0466f2d994d52a8.tar.bz2 gerbonara-1cb269131bc52f0b1a1e69cef0466f2d994d52a8.zip |
Allow negative render of soldermask per #50
Update example code and rendering to show change
Diffstat (limited to 'gerber/cam.py')
-rw-r--r-- | gerber/cam.py | 10 |
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) |