diff options
author | Hamilton Kibbe <hamilton.kibbe@gmail.com> | 2016-11-06 14:44:40 -0500 |
---|---|---|
committer | Hamilton Kibbe <hamilton.kibbe@gmail.com> | 2016-11-06 14:44:40 -0500 |
commit | 422c86bcc684ea94515862b0dd3a39ce0f4bd86f (patch) | |
tree | a1efe6504e40083e61dcbe412c243fd8c00628f3 /gerber/render/render.py | |
parent | ede065e6d16e1e4ffe970c8b13945139b3f4bcb2 (diff) | |
parent | 22e668c75f24174d2090443ed98e804b3737bd84 (diff) | |
download | gerbonara-422c86bcc684ea94515862b0dd3a39ce0f4bd86f.tar.gz gerbonara-422c86bcc684ea94515862b0dd3a39ce0f4bd86f.tar.bz2 gerbonara-422c86bcc684ea94515862b0dd3a39ce0f4bd86f.zip |
Merge upstream changes
Diffstat (limited to 'gerber/render/render.py')
-rw-r--r-- | gerber/render/render.py | 23 |
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 |