summaryrefslogtreecommitdiff
path: root/gerber/render/render.py
diff options
context:
space:
mode:
authorHamilton Kibbe <hamilton.kibbe@gmail.com>2015-12-22 02:45:48 -0500
committerHamilton Kibbe <hamilton.kibbe@gmail.com>2015-12-22 02:47:23 -0500
commit6f876edd09d9b81649691e529f85653f14b8fd1c (patch)
tree808e3ea789816452f52e834d4c5c1744bdee6541 /gerber/render/render.py
parentaf5541ac93b222c05229ee05c9def8dbae5f6e25 (diff)
downloadgerbonara-6f876edd09d9b81649691e529f85653f14b8fd1c.tar.gz
gerbonara-6f876edd09d9b81649691e529f85653f14b8fd1c.tar.bz2
gerbonara-6f876edd09d9b81649691e529f85653f14b8fd1c.zip
Add PCB interface
this incorporates some of @chintal's layers.py changes PCB.from_directory() simplifies loading of multiple gerbers the PCB() class should be pretty helpful going forward... the context classes could use some cleaning up, although I'd like to wait until the freecad stuff gets merged, that way we can try to refactor the context base to support more use cases
Diffstat (limited to 'gerber/render/render.py')
-rw-r--r--gerber/render/render.py19
1 files changed, 5 insertions, 14 deletions
diff --git a/gerber/render/render.py b/gerber/render/render.py
index 737061e..c76ead5 100644
--- a/gerber/render/render.py
+++ b/gerber/render/render.py
@@ -60,7 +60,6 @@ class GerberContext(object):
def __init__(self, units='inch'):
self._units = units
self._color = (0.7215, 0.451, 0.200)
- self._drill_color = (0.25, 0.25, 0.25)
self._background_color = (0.0, 0.0, 0.0)
self._alpha = 1.0
self._invert = False
@@ -150,7 +149,7 @@ class GerberContext(object):
elif isinstance(primitive, Polygon):
self._render_polygon(primitive, color)
elif isinstance(primitive, Drill):
- self._render_drill(primitive, self.drill_color)
+ self._render_drill(primitive, color)
elif isinstance(primitive, TestRecord):
self._render_test_record(primitive, color)
else:
@@ -185,15 +184,7 @@ class GerberContext(object):
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')
+ def __init__(self, settings=None):
+ self.settings = settings
+ self.primitives = []
+