summaryrefslogtreecommitdiff
path: root/gerber/render/render.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/render/render.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/render/render.py')
-rw-r--r--gerber/render/render.py21
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')