eps Path imported as a (very) large number of sub-pathes

Post questions on how to use or achieve an effect in Inkscape.
Calvert

eps Path imported as a (very) large number of sub-pathes

Postby Calvert » Thu Aug 26, 2010 6:57 pm

Hi !

I am regularly using inkcape to import and modify eps files (scientific plots). These files contain many different curves, each of them composed of a large number of nodes (usually, between few thousends to ~100'000 nodes).

My problem is that during the importation, inkscape does not recognise one curve as a single path, but as a number of different path (and sometimes, it is a lot !). I usually select a curve using its color, and then combine together all the sub-paths (ctrl-k). This works fine, but the final path is not a path with two terminal nodes, but with a lot of them everywhere along the curve.

My question is: is there a way either to import properly the eps file, in order to have single paths "ab initio", or to merge the sub-paths together in a single path, with an unique terminal node at each extremities, or to easily convert the intermediate terminal nodes in "normal" nodes (whithout selecting each couple of terminal nodes individually, and linking them with a new segment, because I had to do that sometimes several thousends of time...) ??

Thanks for any answer !

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: eps Path imported as a (very) large number of sub-paths

Postby druban » Fri Aug 27, 2010 4:39 pm

Hello Calvert.
It sounds like a bit of a problem to do what you want and without seeing your file I am not sure that this will work but give it a try.
So you have a large number of paths. I shall assume that all of them are open paths and are not self intersecting for the following to work.
Use the select tool to select all and combine them (ctrl k). Combining may be unnecessary if you have upgraded to .48.
Switch to the node tool (n). You should see all the nodes. Select all (ctrl a). All the nodes should be highlighted.
the fifth button in the nodetool control bar joins selected endnodes with a segment. Click this. all your segments should be connected now but you will also probably have a couple (only a couple if your'e lucky) of unwanted segments connecting the first and last points or maybe some others as well. deselect everything (esc) and select all the segments you want removed by shift clicking with the node tool on each segment. The sixth button in the nodetool control bar deletes selected line segments.
Now you should have only a little cleanup to do before you have what you want.
Please note that I have not tried this with 10,000 points. :twisted:
Or even a thousand. :twisted:
Works with a few hundred, though. Good luck.
Your mind is what you think it is.

Guest

Re: eps Path imported as a (very) large number of sub-pathes

Postby Guest » Fri Aug 27, 2010 7:18 pm

This solution seem to work fine ! I test it up to more than 10'000 nodes without problems. This solution works with 0.48 and not 0.47 (I just upgraded now, and that's fine !)

Thanks a lot !

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: eps Path imported as a (very) large number of sub-pathes

Postby druban » Sat Aug 28, 2010 4:37 pm

Glad to hear it worked :D , and with such a large number of nodes as well :!: , just goes to show how robust Inkscape's coding is. kudos to the team :D
Your mind is what you think it is.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: eps Path imported as a (very) large number of sub-pathes

Postby ~suv » Sat Aug 28, 2010 5:57 pm

Guest wrote:This solution works with 0.48 and not 0.47
Yes, this feature was only implemented in the new node tool that comes with Inkscape 0.48:
Release notes 0.48 wrote:Improved node join:
… More than two endnodes can be joined at once—the distances between nodes will be used to determine which nodes to join, with the closest pairs being joined first. …
Improved segment join:
… More than one segment can be created at once—the distances between nodes will be used to determine which nodes to join with a segment, with the closest pairs being joined first. …


Return to “Help with using Inkscape”