Skip to content

Commit

Permalink
Excellon parser fix, background rendering fix
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcarne committed Nov 2, 2009
1 parent 5d0fa09 commit ffa18d5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
4 changes: 2 additions & 2 deletions gerberDRC/excellonLoader.py
Expand Up @@ -131,8 +131,8 @@ def parseExcellon(file):
current_tool = int(m.group("id"))

elif i.startswith("X") or i.startswith("Y"):

m = re.findall(r"([XY][+-][0-9.]+)", i)
m = re.findall(r"([XY][+-]?[0-9.]+)", i)

x = None
y = None
Expand Down
14 changes: 11 additions & 3 deletions plot_test.py
Expand Up @@ -97,7 +97,7 @@ def setBackground(cr, outlines):
for x,y in i[1:]:
cr.line_to(x,y)
cr.close_path()
cr.fill()
cr.fill()
else:
cr.paint()

Expand All @@ -113,6 +113,11 @@ def choosePlotSettings(rentype):
ps.drawinverted = False
ps.strokeZeroWidthLines = True


if mode == "ALL_BLACK":
ps.ovr = 0
ps.ovg = 0
ps.ovb = 0
if mode == "EAGLE":
if (rentype.startswith("SILKSCREEN")):
ps.ovr = 0.9
Expand Down Expand Up @@ -150,6 +155,8 @@ def choosePlotSettings(rentype):
ps.ovr = 0.84765625
ps.ovg = 0.52734375
ps.ovb = 0.09765625
ps.strokeZeroWidthLines = False

elif (rentype.startswith("SOLDERMASK_TOP")):
ps.alpha = 0.8
ps.drawfilled = True
Expand Down Expand Up @@ -207,7 +214,7 @@ def renderGerberFile(rep, cr, rentype, outlines):

layers = {}
c=0
path = "examples/gerbers/"
path = "examples/HEXAPOD/"
for i in os.listdir(path):
print "Parsing: %s" % i
identification = identifyLayer(i)
Expand Down Expand Up @@ -349,4 +356,5 @@ def point_hash(x,y):
cr.fill()

fo = open('render/layers.png', 'w')
surface.write_to_png(fo)
surface.write_to_png(fo)

0 comments on commit ffa18d5

Please sign in to comment.