combine subpathes in touching points

Bug #400592 reported by hefee
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Invalid
Wishlist
hefee
Nominated for 0.48.x by mir
Nominated for 0.91.x by Glenn Pipe

Bug Description

When you have to subpaths which are touching in one point than this patch will create one big subpath that combines the two subpaths.

in example are numbers are represent points and letters svg:path comands:
-you have two subpaths M1 B2 C3 and M3 D4 E5 the script creates one path M1 B2 C3 D4 E5
-you have two possible flavours of the script in one you leave the subpathes as they are and only start- end endpoint of the subpath will be used, the other floavor is to break oll subpathes into points and lines - so maybe the pathes will be creates in other ways

-to understand the code:
>there is a class named Net that will create a net of points and bond between them with the parsed output of simplepath as input see Net:createNet(cmds)
>to get out the new subpath(s) the function createD is used-you can use the output directiy in the d-Argument in svg:path
> a big testing routine is written to test the creating of the Net and the subpaths see function test

Revision history for this message
hefee (hefee) wrote :
Revision history for this message
hefee (hefee) wrote :
tags: added: extensions-plugins node-editing
removed: closing subpath
Changed in inkscape:
status: New → Confirmed
Revision history for this message
su_v (suv-lp) wrote :

@hefee - do you have any documentation for your extension? I could not get it to work (Inkscape 0.47pre1, OS X 10.5.7) even though I re-read your irc conversation (<inkscape.gristle.org>) about its use at the time when you added it to the bug tracker. The extension didn't fail with an error message but neither did it join any 'subpaths', touching in one or more nodes - I believe I tried every basic scenario I could think of. A drawing illustrating your extensions basic functionality could be very helpful. Sorry I forgot to give any feedback sooner...

~suv

Revision history for this message
hefee (hefee) wrote :

Ok to use my extension:
-first select all pathes to combine
-combine the pathes to one pathset with Path->Combine (Ctrl+K)
-run extension (Combine touching subpathes), the extenstion will create a new path where the subpathes are combined.

I use inkscape 0.46-9 (debian unstable)

hefee

Revision history for this message
su_v (suv-lp) wrote :

like this? Didn't figure out the option 'Keep Subpaths together' yet... Thank you for your contribution!

Revision history for this message
hefee (hefee) wrote :

'Keep Subpathes together' is that only red 1 and 4 and blue 1 and 5 can combine with other subpathes. I think it is the recommended Method)

Otherwise it can be that tow pathes will be created like that: red 1 red 2 blue 2 blue 1 and another one red 4 red 2 blue 4 blue 5. Or they will be combined in a different way. In one word, it is not determenisitc how the subpathes are combined -> maybe disable this option?

Revision history for this message
hefee (hefee) wrote :

I written also a snap to grid feature so that points that are close together will be connected.
Good values for connecting are 0.001-0.01. value 0 deactivatees this feature
Internal it only use a round function for every point -> figure is changend

Revision history for this message
hefee (hefee) wrote :
Revision history for this message
mir (mir-rodriguez) wrote :

Thank you so much for this extension, it is a godsend! Essential for improperly exported or digitised paths for cartography. Also see this bug: https://bugs.launchpad.net/inkscape/+bug/321150

Revision history for this message
hefee (hefee) wrote :

Nice to hear that somebody else needs this extenstion ;) If there is anything I can help with just leave a message. And yes those bugs like 321150 should be solved with this extension.

Revision history for this message
su_v (suv-lp) wrote :

@hefee - assigning this bug to you, I hope that's alright with you? Even though I didn't comment on your updated version I have since used and appreciated your extension in multiple occasions...

Changed in inkscape:
assignee: nobody → hefee (hefee)
importance: Undecided → Wishlist
status: Confirmed → In Progress
Revision history for this message
hefee (hefee) wrote :

@~suv - I'm proud to have my first assigned bug here in inkscape! But what that meas exactly - what I have to do to get this extension into upstream?

Revision history for this message
su_v (suv-lp) wrote :

@hefee - ATM it's 'just' that you are working on it (Status 'In progress'), the importance 'Wishlist' means that its an RFE for Inkscape (to be added in the future). OTOH if you no longer want to develop or maintain it, you can change the assignment back to 'Nobody' and hope that someone else will pick it up from there ;-)
Whether it will be added to the extensions that are bundled with Inkscape needs further discussion here (or maybe in the inkscape-devel list) I assume. It could be helpful to add a more detailed description or SVG file that demonstrates several use cases (e.g. similar to the "Summary of capabilities (SVG)" for the recently filed 'Wireframe spheres' extension in bug #461964 <http://launchpadlibrarian.net/34456048/Wireframe%20sphere%20tutorial.svg>).

Revision history for this message
hefee (hefee) wrote :

Why keep subpathes togesther?

The script can handles subpathes in to diffrent ways. The one way is to keep the subpathes like they are, the other poibility to split all subpathes to lines and splines and recombine them freely.

The longer I think about this feature, I think there is no user of splitting all subpathes first to subelements and then comine them. So it is just history that this featuere is available. Is there anybody you sees an usefull reason to switch it off?

Revision history for this message
hefee (hefee) wrote :

Here a svg that explains the extension and the option snap to grid.

Revision history for this message
hefee (hefee) wrote :

Bugfix:
- with snap to grid on - only start and endpoint willbe changed - all points in the middle of a subpath arn't affected.

Revision history for this message
Glenn Pipe (ggpipe) wrote :

I tried running your extension in Inkscape 0.48, using your instructions to select the vectors, combine paths, then combine touching but I get the following error:

Traceback (most recent call last):

  File "combine_touching.py", line 282, in <module>
    e.affect()
  File "C:\Program Files\Inkscape\share\extensions\inkex.py", line 215, in affect
    self.effect()
  File "combine_touching.py", line 276, in effect
    net.createNet(simplepath.parsePath(node.get('d'))) #create the net
  File "combine_touching.py", line 91, in createNet
    methods[method](point[1])
KeyError: 'A'

I imported the clamp.dxf file from here and tried selecting the top part
http://www.thingiverse.com/download:3138

How do I fix this?

jazzynico (jazzynico)
Changed in inkscape:
milestone: none → 0.49
Revision history for this message
Krzysztof Kosinski (tweenk) wrote :

This extension does exactly the same thing as the "Join nodes" command in the new node tool. Marking invalid.

Changed in inkscape:
status: In Progress → Invalid
Revision history for this message
hefee (hefee) wrote :

@Krzysztof Kosinski can you explain me how to use the "join nodes" command to get the same effekt like with tool? I don't get it! or is it coming in 0.49?

Revision history for this message
hefee (hefee) wrote :

Glenn Pipe's bug is now solved with this version.

This bug pushed me to read the w3c standard more carefully and now ALL paths commands will be handeled correctly (hopefully ;)

Bugfixes:
- added quadratic Bézier curve support (Q command)
- added elliptical arc curve support (A command)
- more tests for the new commands
- cleanup code
(H,V,S,T are transformed via simplepath, a standard inkscape script)

Revision history for this message
Krzysztof Kosinski (tweenk) wrote :

hefee: Just select both paths, select the nodes you want to join ("touching nodes"), and click the Join Nodes button on the control bar. You need Inkscape 0.48 for this.

Revision history for this message
hefee (hefee) wrote :

Krzysztof Kosinski: Ok yes this is a solution that works. But for not so many points, but if you have many many paths that you want to combine this doesn't make fun to select more than 50 points an click and click again... Do you tried my plugin?

My plugin make it automatic. You just have to put all paths to gether to subpathes and than the plugin can combine on its own.

I really think my plugin is very usefull for imports of dxf files!

Revision history for this message
su_v (suv-lp) wrote :

> this doesn't make fun to select more than 50 points an click and click again...

There are several other methods available to select multiple nodes in the node tool than (shift-)clicking individual nodes, see
<http://tavmjong.free.fr/INKSCAPE/MANUAL_v16/html/Paths-Editing.html#Paths-Node-Selecting>.

Revision history for this message
hefee (hefee) wrote :

Maybe see the sample of Glenn Pipe there you see some paths that you want to combine, for example the outerline of the upper part. How can I join these pathes easily with standard tools? The only way I see is to select the two nodes, combine them, select the next two...

Revision history for this message
hefee (hefee) wrote :

Ah now ~suv have explained me how to use the new tool: And yes fo inkscape 0.48 my plugin is obsolete...
for the example the sample of Glenn Pipe 'clamp.dxf':
- import and select all pathes (deselect text)
- use node tool <F2>
- Ctrl+A (select all nodes)
- use "join selected nodes" (3. from left)

->all six subpathes are connected, like in my tool ;)

Revision history for this message
su_v (suv-lp) wrote :
Revision history for this message
su_v (suv-lp) wrote :

Changing milestone to 0.48 as per comment #18 (implemented internally in new node tool of 0.48).

Changed in inkscape:
milestone: 0.49 → 0.48
Changed in inkscape:
milestone: 0.48 → none
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

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