Cleanup, rendering fixes.
fixed rendering of tented vias fixed rendering of semi-transparent layers fixed file type detection issues added some examples
This commit is contained in:
parent
b9f1b106c3
commit
5df38c014f
26 changed files with 401 additions and 231 deletions
|
|
@ -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,8 +63,9 @@ 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.invert = False
|
||||
self.ctx = None
|
||||
|
||||
@property
|
||||
|
|
@ -125,14 +127,6 @@ class GerberContext(object):
|
|||
raise ValueError('Alpha must be between 0.0 and 1.0')
|
||||
self._alpha = alpha
|
||||
|
||||
@property
|
||||
def invert(self):
|
||||
return self._invert
|
||||
|
||||
@invert.setter
|
||||
def invert(self, invert):
|
||||
self._invert = invert
|
||||
|
||||
def render(self, primitive):
|
||||
color = self.color
|
||||
if isinstance(primitive, Line):
|
||||
|
|
@ -156,7 +150,6 @@ class GerberContext(object):
|
|||
else:
|
||||
return
|
||||
|
||||
|
||||
def _render_line(self, primitive, color):
|
||||
pass
|
||||
|
||||
|
|
@ -186,8 +179,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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue