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.
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
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).
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.