Hello!
I have some badly exported vector engineering drawings that I want to optimize. They are broken into lots of small paths and so I have hundreds of objects. Is there a way to automatically select all the end nodes so I can just join them?
Automaticaly select all end nodes
Re: Automaticaly select all end nodes
Welcome to InkscapeForum!
If the end nodes that need to be joined are either on top of each other, or at least nearby each other, it can probably be done relatively easily in a couple of steps.
With Selection tool engaged, do Ctrl + A (Select All).
Switch to Node tool and do Ctrl + A again, which selects all nodes.
If all the nodes to be joined are already on top of each other, just click Join Selected Nodes button on Node tool control bar.
However, if any end nodes should be left unjoined, then after the 2nd Ctrl + A, hold Shift key, and click on the end nodes that are not to be joined. That deselects them, so that they won't be included in the Joining. If you do accidentally join nodes that shouldn't be, you'll see the result on the canvas.
If the end nodes that need to be joined are either on top of each other, or at least nearby each other, it can probably be done relatively easily in a couple of steps.
With Selection tool engaged, do Ctrl + A (Select All).
Switch to Node tool and do Ctrl + A again, which selects all nodes.
If all the nodes to be joined are already on top of each other, just click Join Selected Nodes button on Node tool control bar.
However, if any end nodes should be left unjoined, then after the 2nd Ctrl + A, hold Shift key, and click on the end nodes that are not to be joined. That deselects them, so that they won't be included in the Joining. If you do accidentally join nodes that shouldn't be, you'll see the result on the canvas.
Basics - Help menu > Tutorials
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Re: Automaticaly select all end nodes
With Ctrl-A, for some reason I barely select any nodes. I also tried Edit-Find and then searching for everything that isn't text, but that joins a lot of nodes that should't join. Here is an example file: https://www.dropbox.com/s/wnf52xsepxkz4jo/2020%20za%20svg.svg
A similar file where all the lines of the bottle is almost twice smaller and renders quicker: https://www.dropbox.com/s/xmjq5up4suqmc21/1005.svg
So far the only way I could join lines is by selecting two or more individual lines and then selecting the overlapping nodes by circling them and then joining them. When overlapping nodes are selected they turn black. If I select all the nodes they join the wrong way.
A similar file where all the lines of the bottle is almost twice smaller and renders quicker: https://www.dropbox.com/s/xmjq5up4suqmc21/1005.svg
So far the only way I could join lines is by selecting two or more individual lines and then selecting the overlapping nodes by circling them and then joining them. When overlapping nodes are selected they turn black. If I select all the nodes they join the wrong way.
Re: Automaticaly select all end nodes
If the nodes are truly overlapping, when they are selected, they seem to disappear. So it might look like they aren't selected. (they seem to disappear against a white background, but they may show up better on a non-white background)
When I looked at your 1st sample file, I find everything grouped. In order to use the technique I described, you'd have to ungroup everything. I had to click Ungroup button 20 or 30 times to get everything ungrouped! (I thought there was an Ungroup All command, but I couldn't find it -- maybe I was dreaming, lol) After I join all the nodes, I do see that some things were joined that shouldn't have been.
In this case, it's very hard to tell which nodes need to be deselected, before finally joining nodes. .....hhmmm.... Ok, this would be my approach.
I would duplicate the entire image, and move the duplicate to a layer below the original. It might help to make the strokes a different color. Then hide it. Now perform the steps I suggested and join everything. Now you can unhide the duplicate, and use it to snap the nodes back into place. In some cases, it looks like connections were made that can now be deleted. But in other cases, you should be able to snap the nodes back into place.
Question -- I see that the text has been converted to paths. Do you need the nodes of the text joined? Joining the nodes of the text by itself would be a challenge! Maybe with selecting only parts of the whole drawing, you could join all the nodes for a certain portion, before moving on to the next area. But with that image, it's just going to be a long process. For that spinner looking object on top, the process works beautifully! The bottle will need some cleanup after the process. But the text will be the worst, imo.
Hhm... Well, that certainly would make a nice tool, or extension, or something, to be able to select only the endnodes! For this image, or any like it, I think you'll just have to be clever about the intial selection. You can probably use that process on different sections at a time. I don't know any way to select only the endnodes. But your biggest problem with the 1st sample image, is that you can't easily identify which nodes need to be excluded from the Join.
When I looked at your 1st sample file, I find everything grouped. In order to use the technique I described, you'd have to ungroup everything. I had to click Ungroup button 20 or 30 times to get everything ungrouped! (I thought there was an Ungroup All command, but I couldn't find it -- maybe I was dreaming, lol) After I join all the nodes, I do see that some things were joined that shouldn't have been.
In this case, it's very hard to tell which nodes need to be deselected, before finally joining nodes. .....hhmmm.... Ok, this would be my approach.
I would duplicate the entire image, and move the duplicate to a layer below the original. It might help to make the strokes a different color. Then hide it. Now perform the steps I suggested and join everything. Now you can unhide the duplicate, and use it to snap the nodes back into place. In some cases, it looks like connections were made that can now be deleted. But in other cases, you should be able to snap the nodes back into place.
Question -- I see that the text has been converted to paths. Do you need the nodes of the text joined? Joining the nodes of the text by itself would be a challenge! Maybe with selecting only parts of the whole drawing, you could join all the nodes for a certain portion, before moving on to the next area. But with that image, it's just going to be a long process. For that spinner looking object on top, the process works beautifully! The bottle will need some cleanup after the process. But the text will be the worst, imo.
Hhm... Well, that certainly would make a nice tool, or extension, or something, to be able to select only the endnodes! For this image, or any like it, I think you'll just have to be clever about the intial selection. You can probably use that process on different sections at a time. I don't know any way to select only the endnodes. But your biggest problem with the 1st sample image, is that you can't easily identify which nodes need to be excluded from the Join.
Basics - Help menu > Tutorials
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Re: Automaticaly select all end nodes
Don't know any automatic way to do this, but with this drawing it could be done in minutes manually.
- Attachments
-
- hlp30.svg
- (160.02 KiB) Downloaded 139 times