summaryrefslogtreecommitdiff
path: root/gerber/render/render.py
diff options
context:
space:
mode:
authorGarret Fick <garret@ficksworkshop.com>2016-07-17 10:42:03 +0800
committerGarret Fick <garret@ficksworkshop.com>2016-07-17 10:42:03 +0800
commit0dded38353e1d650458f6401aea37a4aadaf28ff (patch)
treea297c26c7cbb6b1c7d7a9cbe4eb4639b203fba53 /gerber/render/render.py
parentd0e9018da0d7c51c2195f641c9189f85378df3e8 (diff)
parentd1598b46c91ee36719460d49d7ba2ed5ecd0ef45 (diff)
downloadgerbonara-0dded38353e1d650458f6401aea37a4aadaf28ff.tar.gz
gerbonara-0dded38353e1d650458f6401aea37a4aadaf28ff.tar.bz2
gerbonara-0dded38353e1d650458f6401aea37a4aadaf28ff.zip
Merge in negative soldermask. Still required further changes to support negatives for shapes that dont exist in the merge source
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 128496f..6ae9392 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
@@ -213,3 +214,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')