summaryrefslogtreecommitdiff
path: root/gerber/render/render.py
diff options
context:
space:
mode:
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')