Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def convert(fp, inputdim=None, name=None, cubic_samples=10):
doc = minidom.parse(fp)
paths = doc.getElementsByTagName('path')
rects = doc.getElementsByTagName('rect')
if len(paths) != 7:
raise ValueError('expected 7
def parseSVG(svgFile):
svgCode = None
with open(svgFile, 'r') as f:
svgCode = f.read()
existingSvgHash = findSvgSyncHashInSVG(svgCode)
print 'hash in SVG file:', existingSvgHash
svgPathDefs, isFigmaSVG = svgGetPaths(svgCode)
paths = []
for pathDef, tr in svgPathDefs:
print 'pathDef:', pathDef, 'tr:', tr
path = parse_path(pathDef)
if tr[0] != 0 or tr[1] != 0:
path = path.translated(vec2(*tr))
paths.append(path)
return paths, existingSvgHash