fix https://github.com/rusefi/alphax-8chan/issues/35 tle9201 not rendered on ibom [now not selectable by mouse cursor for some reason]
This commit is contained in:
parent
2b6dc870dd
commit
fc8ab15823
|
@ -183,7 +183,7 @@ def updateBbox(bbox, padXY, padWH):
|
||||||
def readFootprint(fpname, footprintsPath, des):
|
def readFootprint(fpname, footprintsPath, des):
|
||||||
if not fpname:
|
if not fpname:
|
||||||
return None
|
return None
|
||||||
pat_module = re.compile(r'\((module|footprint)\s+\"?([\w\-\.\:]+)\"?\s+\(layer\s+\"?([FB])')
|
pat_module = re.compile(r'\s*\((module|footprint)\s+\"?([\w\-\.\:]+)\"?\s+(\(version[^\)]*\))?\s*(\(generator[^\)]*\))?\s*\(layer\s+\"?([FB])')
|
||||||
pat_pad = re.compile(r'^\s*\(pad\s+\"?([0-9A-Z]+)\"?\s+(\w+)\s+(\w+)\s+\(at\s+([+\-0-9e\.]+)\s+([+\-0-9e\.]+)\s*([+\-0-9\.]+)?\)\s+\(size\s+([+\-0-9\.]+)\s+([+\-0-9\.]+)\)(\s*\(drill\s+([+\-0-9\.]+)\))?\s+\(layer[s]?\s+\"?([^\)]+)\)(\s*\(roundrect_rratio\s+([+\-0-9\.]+)\))?')
|
pat_pad = re.compile(r'^\s*\(pad\s+\"?([0-9A-Z]+)\"?\s+(\w+)\s+(\w+)\s+\(at\s+([+\-0-9e\.]+)\s+([+\-0-9e\.]+)\s*([+\-0-9\.]+)?\)\s+\(size\s+([+\-0-9\.]+)\s+([+\-0-9\.]+)\)(\s*\(drill\s+([+\-0-9\.]+)\))?\s+\(layer[s]?\s+\"?([^\)]+)\)(\s*\(roundrect_rratio\s+([+\-0-9\.]+)\))?')
|
||||||
|
|
||||||
fpFileName = footprintsPath + "/" + fpname + ".kicad_mod"
|
fpFileName = footprintsPath + "/" + fpname + ".kicad_mod"
|
||||||
|
@ -195,10 +195,14 @@ def readFootprint(fpname, footprintsPath, des):
|
||||||
json = {"drawings": [], "pads": []}
|
json = {"drawings": [], "pads": []}
|
||||||
bbox = [[ 9999.0, 9999.0 ], [ -9999.0, -9999.0 ]]
|
bbox = [[ 9999.0, 9999.0 ], [ -9999.0, -9999.0 ]]
|
||||||
with open(fpFileName, 'rt') as f:
|
with open(fpFileName, 'rt') as f:
|
||||||
|
# module definition can be multiline
|
||||||
|
allFile = f.read()
|
||||||
|
f.seek(0)
|
||||||
|
module = pat_module.match(allFile)
|
||||||
|
if module:
|
||||||
|
json["layer"] = module.group(5)
|
||||||
|
# pad definitions are single-line
|
||||||
for line in f:
|
for line in f:
|
||||||
module = pat_module.match(line)
|
|
||||||
if module:
|
|
||||||
json["layer"] = module.group(3)
|
|
||||||
pad = pat_pad.match(line)
|
pad = pat_pad.match(line)
|
||||||
if pad:
|
if pad:
|
||||||
padIdx = pad.group(1)
|
padIdx = pad.group(1)
|
||||||
|
|
Loading…
Reference in New Issue