fablabnbg / inkscape-paths2openscad

Inkscape extension for designing simple 3D objects (2.5D actually) with inkscape. DOWNLOAD: https://github.com/fablabnbg/inkscape-paths2openscad/releases/latest
http://www.thingiverse.com/thing:25036/#comment-1233550
GNU General Public License v2.0
76 stars 18 forks source link

Unable to use Inkscape 1.0.1 #19

Closed abacon118 closed 3 years ago

abacon118 commented 3 years ago

I have set up Inkscape paths2openscad on my Windows 10 system running Inkscape 1.0.1 and OpenSCAD 2019.5 and I get the following error after I click apply. I did reinstall Inkscape and rename all Inkscape folders to _OLD. I did try some of the provided examples and had the same issues. Environmental variables have been set. I copied everything in the Zip folder download to the Inkscape extensions folder.

It works fine in Inkscape 0.92.5. I am unable to get the '{NAME}.scad' variable to work. That is not a big issue since I just have it export to a certain location and change the name. The only other issue is that once it opens OpenSCAD, I can't use Inkscape since it freezes up. It is fine after I close OpenSCAD. I think it would also be nice is there was an option to close OpenSCAD after the files are processed.

This program will save me a lot of time instead of using Fusion360 (takes a while to export and is not accurate to size). Thank you for all of your hard work to make this awesome extension.

Any suggestions to run in Inkscape 1.0.1 and to get the '{NAME}.scad' variable to work?

========================= paths2openscad.py:391: DeprecationWarning: inkex.localize was moved to inkex.localization.localize inkex.localize() # does not help for localizing my .inx file paths2openscad.py:394: DeprecationWarning: Effect.OptionParser or optparse has been deprecated and replaced with argparser.You must change self.OptionParser.add_option to self.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option( paths2openscad.py:399: DeprecationWarning: Effect.OptionParser or optparse has been deprecated and replaced with argparser.You must change self.OptionParser.add_option to self.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option( paths2openscad.py:403: DeprecationWarning: Effect.OptionParser or optparse has been deprecated and replaced with argparser.You must change self.OptionParser.add_option to self.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option( paths2openscad.py:407: DeprecationWarning: Effect.OptionParser or optparse has been deprecated and replaced with argparser.You must change self.OptionParser.add_option to self.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option( paths2openscad.py:411: DeprecationWarning: Effect.OptionParser or optparse has been deprecated and replaced with argparser.You must change self.OptionParser.add_option to self.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option( paths2openscad.py:415: DeprecationWarning: Effect.OptionParser or optparse has been deprecated and replaced with argparser.You must change self.OptionParser.add_option to self.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option( paths2openscad.py:419: DeprecationWarning: Effect.OptionParser or optparse has been deprecated and replaced with argparser.You must change self.OptionParser.add_option to self.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option( paths2openscad.py:423: DeprecationWarning: Effect.OptionParser or optparse has been deprecated and replaced with argparser.You must change self.OptionParser.add_option to self.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option( paths2openscad.py:427: DeprecationWarning: Effect.OptionParser or optparse has been deprecated and replaced with argparser.You must change self.OptionParser.add_option to self.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option( paths2openscad.py:431: DeprecationWarning: Effect.OptionParser or optparse has been deprecated and replaced with argparser.You must change self.OptionParser.add_option to self.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option( paths2openscad.py:435: DeprecationWarning: Effect.OptionParser or optparse has been deprecated and replaced with argparser.You must change self.OptionParser.add_option to self.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option( paths2openscad.py:439: DeprecationWarning: Effect.OptionParser or optparse has been deprecated and replaced with argparser.You must change self.OptionParser.add_option to self.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option( paths2openscad.py:442: DeprecationWarning: Effect.OptionParser or optparse has been deprecated and replaced with argparser.You must change self.OptionParser.add_option to self.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option( paths2openscad.py:446: DeprecationWarning: Effect.OptionParser or optparse has been deprecated and replaced with argparser.You must change self.OptionParser.add_option to self.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option( paths2openscad.py:449: DeprecationWarning: Effect.OptionParser or optparse has been deprecated and replaced with argparser.You must change self.OptionParser.add_option to self.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option( paths2openscad.py:454: DeprecationWarning: Effect.OptionParser or optparse has been deprecated and replaced with argparser.You must change self.OptionParser.add_option to self.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option( paths2openscad.py:457: DeprecationWarning: Effect.OptionParser or optparse has been deprecated and replaced with argparser.You must change self.OptionParser.add_option to self.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option( paths2openscad.py:461: DeprecationWarning: Effect.OptionParser or optparse has been deprecated and replaced with argparser.You must change self.OptionParser.add_option to self.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option( paths2openscad.py:1439: DeprecationWarning: Effect.affect is now Effect.run(). The output argument has changed. e.affect() paths2openscad.py:611: DeprecationWarning: simpletransform.parseTransform -> Transform(str).matrix self.docTransform = simpletransform.parseTransform('scale(%f,%f)' % (sx, sy)) paths2openscad.py:947: DeprecationWarning: simpletransform.parseTransform -> Transform(str).matrix matCurrent, simpletransform.parseTransform(node.get("transform"))) paths2openscad.py:946: DeprecationWarning: simpletransform.composeTransform -> Transform(M1) Transform(M2) matNew = simpletransform.composeTransform( paths2openscad.py:627: DeprecationWarning: simplepath.parsePath -> element.path.to_arrays() sp = simplepath.parsePath(path) paths2openscad.py:633: DeprecationWarning: cubicsuperpath.CubicSuperPath -> None p = cubicsuperpath.CubicSuperPath(sp) paths2openscad.py:639: DeprecationWarning: simpletransform.applyTransformToPath -> Path(path).transform(mat) simpletransform.applyTransformToPath(transform, p) paths2openscad.py:337: DeprecationWarning: inkex.bezier.maxdist -> Get maximum distance within bezier curve if cspsubdiv.maxdist(b) > flat: paths2openscad.py:342: DeprecationWarning: inkex.bezier.beziersplitatt -> Split bezier at given time one, two = bezmisc.beziersplitatt(b, 0.5) Traceback (most recent call last): File "paths2openscad.py", line 1439, in e.affect() File "C:\Program Files\Inkscape\share\inkscape\extensions\inkex\deprecated.py", line 181, in affect return self.run(args=args) File "C:\Program Files\Inkscape\share\inkscape\extensions\inkex\base.py", line 140, in run self.save_raw(self.effect()) File "paths2openscad.py", line 1290, in effect self.convertPath(key) File "paths2openscad.py", line 759, in convertPath contains = [[] for i in xrange(len(path))] NameError: name 'xrange' is not defined sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name='{NAME}.scad' mode='w' encoding='cp1252'>

image image image image image

u0nel commented 3 years ago

So I'm using this, but I fixed it by replacing xrange with range, because xrange was removed with python3.

jnweiger commented 3 years ago

Should be fixed by https://github.com/fablabnbg/inkscape-paths2openscad/pull/17 Thanks to @sillyfrog