# Affect only vertices with more than 2 edges in Geometry Nodes

I want to build a road in Geometry Nodes. For that I want the the input to be a mesh line. The Line follows the Path of the road.

I want the node tree to "see" junctions, AKA vertices with more than two edges. Is there a way to get these values in Geometry Nodes?

Thanks alot in advance, first time posting here, hopefully I didnt forget anything :D

Edit: Using 3.1

Here's a very simple solution

and here is the result

This relies on the Vertex Neighbors node, which, as the name implies, provides a count of how many vertices are connected to a give vertex by edges (or faces.)

Obviously in my example you will want to replace the Mesh Circle with however you want to draw the intersection, but it's fairly simple in 3.1

You want an intersection wherever there are more than 2 neighbors, so use a simple math Greater Than set to 2 to set the selection. Feed that and the original geometry to an Instances on Points nodes, and use whatever you'd like for your instances.

Node setup:

The node setup creates a cube (you can do there whatever you want, i just wanted to make the result visible) whenever there is a cross section which i defined as vertex count = 4 neighbours.

Note: i hope/think every 4 year old kid knows that you could use a "greater than" node instead of the "compare + not" nodes to get the "exact" goal of the question.

• Very nice :). Can't imagine doing this in any way without GN Mar 15, 2022 at 11:40
• thank you and...well ...with python ;) or animation nodes....or sverchok ;) Mar 15, 2022 at 11:48
• yeah well, that's just a list of more things I never learned :)) Mar 15, 2022 at 11:58