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/render/render.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/render/render.py')
-rw-r--r-- | gerber/render/render.py | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/gerber/render/render.py b/gerber/render/render.py index 8f49796..737061e 100644 --- a/gerber/render/render.py +++ b/gerber/render/render.py @@ -23,12 +23,13 @@ Rendering Render Gerber and Excellon files to a variety of formats. The render module currently supports SVG rendering using the `svgwrite` library. """ + + +from ..primitives import * from ..gerber_statements import (CommentStmt, UnknownStmt, EofStmt, ParamStmt, CoordStmt, ApertureStmt, RegionModeStmt, - QuadrantModeStmt, -) + QuadrantModeStmt,) -from ..primitives import * class GerberContext(object): """ Gerber rendering context base class @@ -182,3 +183,17 @@ class GerberContext(object): def _render_test_record(self, primitive, color): pass + +class Renderable(object): + def __init__(self, color=None, alpha=None, invert=False): + self.color = color + self.alpha = alpha + self.invert = invert + + def to_render(self): + """ Override this in subclass. Should return a list of Primitives or Renderables + """ + raise NotImplementedError('to_render() must be implemented in subclass') + + def apply_theme(self, theme): + raise NotImplementedError('apply_theme() must be implemented in subclass') |