How to select long edges using Geometry Nodes

Hi all,

This seems/sounds simple and likely my total inability to handle Geometry Nodes isn’t helping.

Given a simple subdivided plane mesh like:

I need a Geometry Node setup that would let me select just each of the long edges (basically the blue lines) and then convert each long edge into a curve, keeping the same points along the way and any curvature that the mesh may have.

Can anyone help?

will there always be only “one” edge in the middle?

Hard to totally see into the future, but if it makes it easier/doable, lets say yes.

Would it make a difference if there could be zero or one through the middle, but never more then one.

So no one knows how to do it or is it just not possible?

You didn’t really gave us much information to be honest…

Is this some arbitrary mesh? Or do you start from a Grid Node? If the latter is the case, i could think of an Index or a Direction based option:

Otherwise, you might want to look up how to select Edge Loops with Geometry Nodes:

Good luck!

It could be just some general plane mesh of some sort of length, with x number of subdivisions along the long edge but only 0 or 1 through the long length.

So this could be ‘hand’ made or as part of an earlier nodes setup.

I’ll give your Index option a try, which in theory should work, so will see.

1 Like

Yeah, pretty vague question,

So I’ll give a vague answer,

Shortest path?

Hope that helps.

1 Like

Sorry, I don’t get what’s so vague about it.

The image shows a basic subdivided plane, the blue lines show what I want to be able to select, which isn’t the shortest path, its the longest path.

Then, given that selection, turn those long lines into curves which has the same points along it based on the existing subdivisions.

but since you can consider a path to be the shortest distance to another point then the answer is relevant, I suggest you look at the node.

Hope that helps.

Using the Shortes Edge Paths node is a great advice!
Combining it with the Edge Paths to Curves node and and iterating over every point in the mesh, you should get the Edge Paths going from any point to every other point in your mesh. The “only” thing you then have to do is to filter out all the curves you don’t need (e.g. curves with an abrupt direction change or smaller ones).


Nodegroup in the bottom left:

As long as there’s no hard direction change in the mesh it should work (although a bit finicky):

Good luck!

2 Likes

Ok, that works, but how complicated it all is, for something like selecting long edge loops that one can do with a mouse click.

Of course it’s easier to just select the edge loop you want instead of letting an algorithm figure it out.
But keep in mind that my solution doesn’t necessarly returns edge loops only! It’s just the shorteste path from one vertex to another. If that is a requirement you could adjust the setup from the link i posted above and loop over all edges to find the largest edge loops in the mesh.