brad / Inkscape-OpenSCAD-DXF-Export

Inkscape plugin that exports DXF files usable by OpenSCAD

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No module named cspsubdiv SNAP install

deepfriedcode opened this issue · comments

Installed Inkscape through snap, installed this extension and upon saving an SVG to DXF I get

Traceback (most recent call last):
  File "openscad_dxf.py", line 33, in <module>
    import cspsubdiv
ImportError: No module named cspsubdiv

Upon which i did

cp -r --symbolic-link /snap/inkscape/5874/lib/share/../../share/inkscape/extensions/* openscad_dxf/

which yielded

Traceback (most recent call last):
  File "openscad_dxf.py", line 287, in <module>
    OpenSCADDXFEffect().affect()
  File "openscad_dxf.py", line 48, in __init__
    object2path.ObjectToPath.__init__(self)
  File "/home/XXX/snap/inkscape/5874/extensions/openscad_dxf/inkinkex.py", line 73, in __init__
    self.inkscape_path = inkutils.find_inkscape_path()
  File "/home/XXX/snap/inkscape/5874/extensions/openscad_dxf/inkutils.py", line 26, in find_inkscape_path
    "Can't find the path of the Inkscape executable.")
inkutils.InkscapeEnvironmentError: Can't find the path of the Inkscape executable.

to which I added

    for path in [
            "/usr/%s/inkscape" % path_type, "/usr/local/%s/inkscape" % path_type,
            "/Applications/Inkscape.app/Contents/Resources/%s/inkscape" % path_type,
            "/snap/bin/inkscape"]:
        if os.path.exists(path):

And now it works.

Let me know if you need a PR or something. Have a nice day.