How to use the svgpathtools.parse_path function in svgpathtools

To help you get started, we’ve selected a few svgpathtools examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NiklasRosenstein / houdini-nodeshape-converter / convert.py View on Github external
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 
github ipfs-shipyard / ipfs-ui-style-guide / fonts / inter / misc / svgsync2.py View on Github external
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