Tool to automatically join lots of small lines to path

Bug #321150 reported by ErikMn
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released
Krzysztof Kosinski

Bug Description

Note: This is a feature request to improve a "bad" vector drawing imported, not a bug concerning current behaviour.

When importing some vector graphics from another program (Matlab, via Adobe Acrobat) I got "curves" which are made up in a bad way: There are only straight subpaths, having two nodes each, and these are not joined.

If the "curve" is bent by moving a node, holes appear because the separate subpaths no longer touch each other, unless endpoints are made round. But even with round endpoints it seems a bit inefficient to use two nodes at each point of the path. Small example: instead of A---B---C, I have a---b c---d where the nodes b and c are at approximately the same position. In places where c---d is at an angle to a---b, holes appear in the joint between b and c, which would have been avoided if all nodes had been part of a single subpath.

Additionally the entire curve in my case is not in one path, there are hundeds of paths, and each has the above described structure with straight line segments that are not joined. To manually first combine the paths and then join every little line segment, e.g. by selecting b and c in the above example and joining them, would probably take a week :-(

A heavily zoomed in cut-out of the drawing I'm discussing is attached, you can tell from the line width that the straight line segments (between nodes) are really short. The bottom half shows the intended result (in this case manually joined).

My wish is a tool that would join all pairs of nodes in the selected path (or preferably across paths if several are selected) where the nodes are considered a pair if they are in the same position (allow selecting a tolerance for offset) and the line width and color is the same.
The latter requirement is intended as a simple sieve to not join to a different kind of line in the background etc.

I don't expect a soultion to be implemented in time to be of any use to me, but submit this request (or use case) in hope of it being considered useful enough to sometime be implemented and improve Inkscape's capability.

Related branches

Revision history for this message
ErikMn (erik-m85) wrote :
Changed in inkscape:
importance: Undecided → Wishlist
tags: added: extensions-plugins node-editing
Revision history for this message
mir (mir-rodriguez) wrote :
Revision history for this message
Krzysztof Kosinski (tweenk) wrote :

Fixed in new node tool. Just select all affect nodes and select "join nodes" from the controls bar. The nodes will be joined according to a pairwise nearest neighbor algorithm.

Changed in inkscape:
status: New → In Progress
assignee: nobody → Krzysztof Kosiński (tweenk)
Changed in inkscape:
status: In Progress → Fix Committed
jazzynico (jazzynico)
Changed in inkscape:
milestone: none → 0.48
jazzynico (jazzynico)
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.