I all! I'd like to announce a new extension for rounding corners or cutting corners of path objects. This is meant to bring inkscape forward in its CAD features. In CAD packages this is a standard feature usually called fillet and chamfer.
It works on entire objects, or on selected nodes of a path. It works perfect with straight edges, but also works quite well, when the edges are curved splines.
Earlier similar extension exist for 0.92 e.g. https://inkscape.org/~crowhoot/%E2%98%85rounded-corners my apologies for reinventing wheels :-) it was a great exercise to learn the much nicer 1.0 inkex API and I enjoyed wrapping my mind around the math.
What is the best way to get it listed on the inkscape.org gallery?
Your extension looks cool. But I use Inkscape 1.01 and I have this answer when I try to use it :
Traceback (most recent call last): File "round_corners.py", line 236, in add_arguments self.tty = open("/dev/tty", 'w') FileNotFoundError: [Errno 2] No such file or directory: '/dev/tty'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "round_corners.py", line 239, in add_arguments self.tty = open("CON:", 'w') # windows. Does this work??? OSError: [WinError 6] Descripteur non valide: 'CON:'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "round_corners.py", line 677, in <module> RoundedCorners().run() File "E:\Programmes\Inkscape\share\inkscape\extensions\inkex\base.py", line 281, in __init__ super(SvgInputMixin, self).__init__() File "E:\Programmes\Inkscape\share\inkscape\extensions\inkex\base.py", line 73, in __init__ self.add_arguments(self.arg_parser) File "round_corners.py", line 241, in add_arguments self.tty = open(os.devnull, 'w') # '/dev/null' for POSIX, 'nul' for Windows. NameError: name 'os' is not defined
@jnweiger Thank you so much! An excellent extension, and a much needed one. I actually think it should be included as a part of Inkscape's feature list. Tested it on Linux and it works great. Unfortunately on Windows I get the same message as @HenriqueDiaz. I created an issue on GitHub about it.
Apparently, this occurs due to os module not being imported. I was able to fix this by changing line 73 in round_corners.py from "import sys, math, pprint, copy" to "import sys, math, pprint, copy, os". @HenriqueDiaz you can try it as well.
Finally I can go through all my lasercut files and round the hell out of those corners. @jnweiger thanks again!
I all!
I'd like to announce a new extension for rounding corners or cutting corners of path objects. This is meant to bring inkscape forward in its CAD features. In CAD packages this is a standard feature usually called fillet and chamfer.
Please check it out at https://github.com/jnweiger/inkscape-round-corners
It works on entire objects, or on selected nodes of a path.
It works perfect with straight edges, but also works quite well, when the edges are curved splines.
Earlier similar extension exist for 0.92 e.g. https://inkscape.org/~crowhoot/%E2%98%85rounded-corners my apologies for reinventing wheels :-) it was a great exercise to learn the much nicer 1.0 inkex API and I enjoyed wrapping my mind around the math.
What is the best way to get it listed on the inkscape.org gallery?
This is a good extension. Thanks for posting.
Hello,
Your extension looks cool. But I use Inkscape 1.01 and I have this answer when I try to use it :
Traceback (most recent call last):
File "round_corners.py", line 236, in add_arguments
self.tty = open("/dev/tty", 'w')
FileNotFoundError: [Errno 2] No such file or directory: '/dev/tty'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "round_corners.py", line 239, in add_arguments
self.tty = open("CON:", 'w') # windows. Does this work???
OSError: [WinError 6] Descripteur non valide: 'CON:'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "round_corners.py", line 677, in <module>
RoundedCorners().run()
File "E:\Programmes\Inkscape\share\inkscape\extensions\inkex\base.py", line 281, in __init__
super(SvgInputMixin, self).__init__()
File "E:\Programmes\Inkscape\share\inkscape\extensions\inkex\base.py", line 73, in __init__
self.add_arguments(self.arg_parser)
File "round_corners.py", line 241, in add_arguments
self.tty = open(os.devnull, 'w') # '/dev/null' for POSIX, 'nul' for Windows.
NameError: name 'os' is not defined
@jnweiger Thank you so much! An excellent extension, and a much needed one. I actually think it should be included as a part of Inkscape's feature list. Tested it on Linux and it works great. Unfortunately on Windows I get the same message as @HenriqueDiaz. I created an issue on GitHub about it.
Apparently, this occurs due to os module not being imported. I was able to fix this by changing line 73 in round_corners.py from "import sys, math, pprint, copy" to "import sys, math, pprint, copy, os". @HenriqueDiaz you can try it as well.
Finally I can go through all my lasercut files and round the hell out of those corners. @jnweiger thanks again!