Open brynnd opened 4 years ago
Actually it would be great to integrate this extension into Inkscape, i.e, in the stock extensions repo https://gitlab.com/inkscape/extensions/. It's almost indispensable when working with DXF export from CAD tools. @jnweiger what do you think?
Main requirements would be:
Yes! Most of my extensions should go to the stock extensions repo. Brynn is probably right, this code here was never tested with 1.0, -- no idea, if it would work or not. Probably not.
This extension is also very useful to me. I hope it will work with the V1.
Errors on V1:
chain_paths.py:49: DeprecationWarning: inkex.localize was moved to inkex.localization.localize
inkex.localize()
chain_paths.py:86: 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('-V', '--version',
chain_paths.py:89: 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('-s', '--snap', action='store', dest='snap_ends', type='inkbool', default=True, help='snap end-points together when connecting')
chain_paths.py:90: 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('-c', '--close', action='store', dest='close_loops', type='inkbool', default=True, help='close loops (start/end of the same path)')
chain_paths.py:91: 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('-u', '--units', action='store', dest="units", type="string", default="mm", help="measurement unit for epsilon")
chain_paths.py:92: 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('-e', '--epsilon', action='store',
chain_paths.py:320: DeprecationWarning: Effect.affect is now Effect.run()
. The output
argument has changed.
e.affect()
chain_paths.py:55: DeprecationWarning: Effect.uutounit est maintenant une méthode dans le document SVG. Utilisez à la place self.svg.uutounit(value, unit)
.
return self.uutounit(nn, uu) # inkscape 0.91
chain_paths.py:177: DeprecationWarning: Effect.selected is now a dict in the svg. Use self.svg.selected
.
if not len(self.selected.items()):
chain_paths.py:182: DeprecationWarning: Effect.selected is now a dict in the svg. Use self.svg.selected
.
for id, node in self.selected.iteritems():
Traceback (most recent call last):
File "chain_paths.py", line 320, in
I have created pull-requests with the required changes: https://github.com/fablabnbg/inkscape-chain-paths/pull/5 https://github.com/fablabnbg/inkscape-chain-paths/pull/6
@veronika I copied / pasted your changes. It is OK for me. Thank you very much !
@veronika
Thank you for your work.
I tried your updated release in Inkscape 1.1 (c68e22c387, 2021-05-23) (Windows 10) but I got from Inkscape this message:
_Traceback (most recent call last):
File "chain_paths.py", line 312, in
@Rigoberdo, I just tried it in 1.1 and I get the same error. I will look into it. It seems we can't concat path segments anymore so we probably need to turn the segment into a string first.
I have created pull-requests with the required changes:
The problem only affected the creation of messages for debug purposes.
Thank you, @veronika!
Now, when I apply "Chain paths" to the four segments in the attached file, I got the following message:
"_Traceback (most recent call last):
File "chain_paths.py", line 312, in
@Rigoberdo, I replaced the old style code of removing a node from the parent to the new style code of calling delete on the node. Please try again.
Hi @veronika, it works fine... nearly. In the attached example, it effectively chains five segment, with slightly detached end points, in a single five node polygon. But it also leaves - for reasons I cannot suppose - two residual segments of original five ones. In the attached figure below, the settings I used. Anyway, thank you indeed Veronika, you did it! Mauro disegno-1.zip
It is not working for me using Inkscape 1.2 on Mac (using the version of this extension from the master branch). The extension shows up in the menu, but when selecting it (with multiple paths selected) nothing happens.
In chain_paths.inx on line 6, change "inkex.py" to "inkex". This change is required for version 1.2 of Inkscape.
Perfect, thank you @veronika!
Hello, Thank you for providing this extension for Inkscape users!
This is just to let you know that most 3rd party Inkscape extensions, like this one, probably will not work with the upcoming new Inkscape version, the long-awaited version 1.0.
Here is the info you need to update this extension, so that it will work with 1.0 and future versions.
https://wiki.inkscape.org/wiki/index.php?title=Updating_your_Extension_for_1.0
If you have further questions, you can contact Inkscape developers via mailing lists, forum, or the chatroom.
If you have already updated it, please disregard this message.
All best, brynn