1. Razen
  2. razencad
  3. Issues
Issue #174 new

SVG import not always work

Anton Veretenenko
created an issue

First, it is not importing SVG pcb layout files exported with Razencad, showing this error:

__init__.py(1181):exception - Plugin exception
Traceback (most recent call last):
  File "rzn/ui/mainwindow.py", line 222, in runPlugin
  File "/home/egoisto/razencad/plugin/import/svg/svg.py", line 58, in main
    self.batchMain(ui.currentTab().project(), {"file":fn})
  File "/home/egoisto/razencad/plugin/import/svg/svg.py", line 63, in batchMain
    import_svg(proj, fn)
  File "/home/egoisto/razencad/plugin/import/svg/svg.py", line 49, in import_svg
    import_elt(proj, elt)
  File "/home/egoisto/razencad/plugin/import/svg/svg.py", line 36, in import_elt
    import_elt(proj, c)
  File "/home/egoisto/razencad/plugin/import/svg/svg.py", line 31, in import_elt
    polys.append(import_polygon(elt))
  File "/home/egoisto/razencad/plugin/import/svg/svg.py", line 21, in import_polygon
    x, y = map(float, pt.split(","))
ValueError: too many values to unpack

Second, is does not import files I made with InkScape, showing this error:

__init__.py(1181):exception - Plugin exception
Traceback (most recent call last):
  File "rzn/ui/mainwindow.py", line 222, in runPlugin
  File "/home/egoisto/razencad/plugin/import/svg/svg.py", line 58, in main
    self.batchMain(ui.currentTab().project(), {"file":fn})
  File "/home/egoisto/razencad/plugin/import/svg/svg.py", line 63, in batchMain
    import_svg(proj, fn)
  File "/home/egoisto/razencad/plugin/import/svg/svg.py", line 49, in import_svg
    import_elt(proj, elt)
  File "/home/egoisto/razencad/plugin/import/svg/svg.py", line 36, in import_elt
    import_elt(proj, c)
  File "/home/egoisto/razencad/plugin/import/svg/svg.py", line 36, in import_elt
    import_elt(proj, c)
  File "/home/egoisto/razencad/plugin/import/svg/svg.py", line 36, in import_elt
    import_elt(proj, c)
  File "/home/egoisto/razencad/plugin/import/svg/svg.py", line 36, in import_elt
    import_elt(proj, c)
  File "/home/egoisto/razencad/plugin/import/svg/svg.py", line 36, in import_elt
    import_elt(proj, c)
  File "/home/egoisto/razencad/plugin/import/svg/svg.py", line 33, in import_elt
    polys.extend(import_path(elt))
  File "/home/egoisto/razencad/plugin/import/svg/svg.py", line 14, in import_path
    return PathParser(elt.attrib.get("d", "")).parse()
  File "/home/egoisto/razencad/plugin/import/svg/path.py", line 76, in parse
    self.eatcmd()
  File "/home/egoisto/razencad/plugin/import/svg/path.py", line 65, in eatcmd
    raise Exception("unhandled path command %s" % (cmd))
Exception: unhandled path command m