summaryrefslogtreecommitdiff
path: root/gerber/render/render.py
diff options
context:
space:
mode:
authorGarret Fick <garret@fickworkshop.com>2016-11-11 15:54:42 +0800
committerGitHub <noreply@github.com>2016-11-11 15:54:42 +0800
commit1e868763a1c4030bedd51553468cbe25f272bef9 (patch)
tree59cef68f1449a5be8d2a9a8ed352e3d9974a3edb /gerber/render/render.py
parent5af19af190c1fb0f0c5be029d46d63e657dde4d9 (diff)
parent60d08dc8ad72f5bb0a14d4821451d7dce20b9639 (diff)
downloadgerbonara-1e868763a1c4030bedd51553468cbe25f272bef9.tar.gz
gerbonara-1e868763a1c4030bedd51553468cbe25f272bef9.tar.bz2
gerbonara-1e868763a1c4030bedd51553468cbe25f272bef9.zip
Merge pull request #5 from hamiltonkibbe/merge-curtacircuitos
Merge curtacircuitos
Diffstat (limited to 'gerber/render/render.py')
-rw-r--r--gerber/render/render.py23
1 files changed, 12 insertions, 11 deletions
diff --git a/gerber/render/render.py b/gerber/render/render.py
index b319648..79f43d6 100644
--- a/gerber/render/render.py
+++ b/gerber/render/render.py
@@ -45,7 +45,8 @@ class GerberContext(object):
Measurement units. 'inch' or 'metric'
color : tuple (<float>, <float>, <float>)
- Color used for rendering as a tuple of normalized (red, green, blue) values.
+ Color used for rendering as a tuple of normalized (red, green, blue)
+ values.
drill_color : tuple (<float>, <float>, <float>)
Color used for rendering drill hits. Format is the same as for `color`.
@@ -62,6 +63,7 @@ class GerberContext(object):
self._units = units
self._color = (0.7215, 0.451, 0.200)
self._background_color = (0.0, 0.0, 0.0)
+ self._drill_color = (0.0, 0.0, 0.0)
self._alpha = 1.0
self._invert = False
self.ctx = None
@@ -136,9 +138,9 @@ class GerberContext(object):
def render(self, primitive):
if not primitive:
return
-
+
self._pre_render_primitive(primitive)
-
+
color = self.color
if isinstance(primitive, Line):
self._render_line(primitive, color)
@@ -164,16 +166,16 @@ class GerberContext(object):
self._render_region(primitive, color)
elif isinstance(primitive, TestRecord):
self._render_test_record(primitive, color)
-
+
self._post_render_primitive(primitive)
-
+
def _pre_render_primitive(self, primitive):
"""
Called before rendering a primitive. Use the callback to perform some action before rendering
a primitive, for example adding a comment.
"""
return
-
+
def _post_render_primitive(self, primitive):
"""
Called after rendering a primitive. Use the callback to perform some action after rendering
@@ -182,7 +184,6 @@ class GerberContext(object):
return
-
def _render_line(self, primitive, color):
pass
@@ -206,10 +207,10 @@ class GerberContext(object):
def _render_drill(self, primitive, color):
pass
-
+
def _render_slot(self, primitive, color):
pass
-
+
def _render_amgroup(self, primitive, color):
pass
@@ -218,8 +219,8 @@ class GerberContext(object):
class RenderSettings(object):
-
- def __init__(self, color=(0.0, 0.0, 0.0), alpha=1.0, invert=False, mirror=False):
+ def __init__(self, color=(0.0, 0.0, 0.0), alpha=1.0, invert=False,
+ mirror=False):
self.color = color
self.alpha = alpha
self.invert = invert