 # Attaching noised edges with springs

Hi,

I have a graph composed of straight line segments (edges) that I would like to slightly “bend” in order to give it a more “natural” (curvy) look.
For now I am using Perlin noise but doing so inevitably displace the ends of each edge.

How could I keep the end vertices together even after noising the edges ?

I am thinking about attaching the vertices with springs but can’t figure out how to do so with Kangaroo 2.

1/ Do you thing this approach is appropriate for this specific case ?
2 If so, would you mind helping me with Kangaroo ?

Graph + noise.gh (16.0 KB)

I don’t think springs are the most natural way to do this.

If I’m understanding you correctly, you want to subdivide a graph and slightly move the vertices in a random way, but without altering the connectivity of the graph.
For this the key thing would be getting a set of unique points and the indices of which of these points are the ends of each line, then move the points and connect the lines to these new locations

wobble_lines.gh (13.9 KB)

Thank you very much for the reply and the example !

I like the simplicity of your approach but it doesn’t really give the kind of output I’m looking for. The lines in your definition are jittery while what I’m trying to achieve is something that has a more curvy and “organic” look (hence the use of noise).

Applying noise only to the inner vertices of each edge (while keeping the end vertices static) somewhat does the trick but angularity can be noticed (obviously) each time a noised vertex (black) gets too far from its static neighbor (red).

The strategy I originally had in mind was the following:

• divide edges (from lines to polylines)
• attach spring between the inner vertices
• attach tiny springs (blue) between the end vertices of adjacent edges

I guess those tiny springs would act as knots preventing the end vertices to get separated while the normal springs attached to them would preserve the overall curvature of the noised polylines.

Do you think that it is feasible ?

Graph + Noise 2.gh (17.5 KB)