[solved] Equidistant nodes along a path?

Post questions on how to use or achieve an effect in Inkscape.
theozh
Posts: 437
Joined: Fri Mar 23, 2012 6:30 pm

[solved] Equidistant nodes along a path?

Postby theozh » Tue Apr 11, 2017 11:01 pm

Is there maybe a smart and fast way to get equally distributed nodes along a given path?

I know that the Align and Distribute dialog (Shift+Ctrl+A) has options to re-arrange nodes, but this is either horizontally or vertically and consequently the shape of the path will be changed.
Any ideas without changing the shape of the path? If necessary some additional nodes can be introduced but just the distance of the nodes along the path should be the same. Maybe some LPE can do this?

NonEquidistantNodesOnPath.png
NonEquidistantNodesOnPath.png (6.44 KiB) Viewed 2884 times
Last edited by theozh on Thu Apr 13, 2017 1:19 am, edited 1 time in total.
Win7/64, Inkscape 0.92.2

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Equidistant nodes along a path?

Postby Moini » Tue Apr 11, 2017 11:25 pm

You could try the ruler LPE, and add nodes at the intersections manually...
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

theozh
Posts: 437
Joined: Fri Mar 23, 2012 6:30 pm

Re: Equidistant nodes along a path?

Postby theozh » Wed Apr 12, 2017 1:30 am

Thanks, @Moini, for the hint to the Ruler LPE. That helps a lot.
For not having to add the nodes manually, you could cut your backbone path with the ruler ticks and combine it again. This way you will get a node at each tick position.
1. object to path
2. break apart
3. unselect backbone
4. combine ticks
5. cut backbone with ticks
6. combine all parts
7. select all nodes (except first and last)
8. join selected nodes

One thing which I haven't found out yet:
if you are deleting the original nodes which are basically defining the curve but might not matching the equidistant steps, you will of course distort the shape of the original path (sometimes more, sometimes less).
The question is: is there "a best way" to minimize distortion when deleting nodes? This might actually be another topic...

EquidistantNodes.png
EquidistantNodes.png (7.82 KiB) Viewed 2856 times
Win7/64, Inkscape 0.92.2

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Equidistant nodes along a path?

Postby Moini » Wed Apr 12, 2017 3:02 am

Neat trick with the cutting :)

I only know about the preference setting for trying to keep path appearance. But that's on by default, so you're probably already using it.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

Polygon
Posts: 393
Joined: Thu Dec 19, 2013 3:27 am

Re: Equidistant nodes along a path?

Postby Polygon » Wed Apr 12, 2017 4:15 pm

Isn´t ->Extension->Modify Path->add Nodes meant for that purpose?
AddNodes.png
AddNodes.png (72.68 KiB) Viewed 2807 times


Cheers
P.

theozh
Posts: 437
Joined: Fri Mar 23, 2012 6:30 pm

Re: Equidistant nodes along a path?

Postby theozh » Wed Apr 12, 2017 4:55 pm

Thanks, @Polygon, as far as I can tell this is not ("globally") equidistant.
This extension is inserting as many additional nodes equally distributed between the existing nodes such that there is a max. segment length between nodes. This doesn't mean that all the nodes are equidistant. (BTW you can enter the distance only in px and with one decimal place).

Top: original path, bottom: added nodes

AddNodes.png
AddNodes.png (2.07 KiB) Viewed 2798 times
Win7/64, Inkscape 0.92.2

Polygon
Posts: 393
Joined: Thu Dec 19, 2013 3:27 am

Re: Equidistant nodes along a path?

Postby Polygon » Wed Apr 12, 2017 7:22 pm

Ok - so you want to spread the nodes with the same distances and count and maintain the curvature?
I´d say this is technically not possible. You can use the extension for adding/spreading points equally and after that delete say every fifth node while "keeping curvature when deleting points" is active via preference - but at a certain stage/progress your curvature will be lost/destroyed:
equally Spread points.png
equally Spread points.png (62.4 KiB) Viewed 2780 times


Cheers
P.

theozh
Posts: 437
Joined: Fri Mar 23, 2012 6:30 pm

Re: Equidistant nodes along a path?

Postby theozh » Wed Apr 12, 2017 9:09 pm

Polygon wrote:Ok - so you want to spread the nodes with the same distances and count and maintain the curvature? I´d say this is technically not possible.

Well, not necessarily with the same count. I agree, with same amount and just redistributing the nodes it might work maybe in some special cases. But with a highly fluctuating path you will need certainly more points.
Win7/64, Inkscape 0.92.2

theozh
Posts: 437
Joined: Fri Mar 23, 2012 6:30 pm

Re: Equidistant nodes along a path?

Postby theozh » Wed Apr 12, 2017 11:51 pm

...some addition:

Top: compare distortions to original path (red) when deleting the original nodes (on the black path)
Middle*: distortions can be minimized by manual adjustment of node handles
Bottom**: "cheating" by taking the original curve (red) with the equidistant nodes of the modified path (black). Here, its stroke is made invisible.

* I don't know how the algorithm behind the "node deletion option"
Edit | Preferences | Tools | Node | "Deleting nodes preserves shape"
works in detail, but with manual adjustment of the node handles you can get better results.

** To make just the path invisible but not the markers (i.e. allow different color for stroke and marker) is actually not as you might think straightforward in the Stroke-Dialog but in
Edit | Preferences | Behaviour | Markers | "Color stock markers the same color as object" unchecked.

EquidistantNodes2.png
EquidistantNodes2.png (18.13 KiB) Viewed 2748 times
Win7/64, Inkscape 0.92.2

theozh
Posts: 437
Joined: Fri Mar 23, 2012 6:30 pm

Re: [solved] Equidistant nodes along a path?

Postby theozh » Thu Apr 27, 2017 3:42 pm

...just for the records... and for those who need a similar pattern...
The disadvantage of the above mentioned method with cutting the path by the ruler ticks still leaves the original nodes which usually do not fit the regular distances. I don't think there is a way to distinguish between the newly created nodes and the original nodes. So, it's tedious to delete the latter ones and moreover the path will most likely change its shape.

To me the simplest way which (at least) mimics a path with equidistant nodes seems to be:
- Use LPE Ruler to create small equidistant ticks
- Object to path (Shift+Ctrl+C)
- Break path apart (Shift+Ctrl+K)
- Select all ticks and rotate them by 90°
- Use stroke (Shift+Ctrl+F) and only set end-markers

Advantages:
- no need for deletion of original nodes
- shape of original path is unchanged
- the marker size can be chosen independently of the stroke width of the original path
Although, to be honest, it's still not "Equidistant nodes along a path" according to the original question, but "Equidistant markers along a path".

EquidistantNodes3.png
EquidistantNodes3.png (6.73 KiB) Viewed 2610 times
Win7/64, Inkscape 0.92.2

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: [solved] Equidistant nodes along a path?

Postby Moini » Fri Apr 28, 2017 12:36 am

Thanks for sharing that trick, theozh! :D
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)


Return to “Help with using Inkscape”