Is there a way to Bridge Edge Loops using Geometry Nodes?
Like if I have two edge loops, each assigned to a different vertex group of the same vert count, is there a way to get Geometry Nodes to bridge them?
The solution for Blender 3.1.2 would be the following:
The vertex groups must be transferred to previously created Group Inputs (type: Boolean), so that these can be used as selection.
With the help of this selection, the upper vertex group is separated from the lower part and the edges thus obtained are extruded by an arbitrary value.
The extruded points are then repositioned with the node Set Position
to the positions of the also separated edges of the upper part.
It should be noted, however, that the number of points is subtracted from the index with the node Transfer Attribute
, because the extruding process has now created twice the number of points. The same result can also be achieved by using the math node Modulo
instead of the subtraction.
Here's my take on it. Currently it is quite hard to instance or join geometry without resorting to "third party" objects. 2.93 is really limited in this regard so I'll use nodes only available in the 3.00 alpha. I hope you're not against using bleeding edge versions.
It breaks easily and is barely customizable but it may be a good start depending on your use case.
I assume you've setup your VGs like that :
Here's the setup :
Explanation :
As you noticed, it doesn't create a bridge, but displaces the bottom row.
One way to circumvent that is to add an edge loop at the bottom and set it all the way next to the bottom edge's vertices. You then need to remove the new vertices from the Bottom VG because they will have a non-zero interpolated value.
Playing with the transform node :
And here is another funny solution for Blender 3.1.2:
This one simply creates a new mesh from the separated edges of the top and bottom parts with the node Convex Hull
, from which the top and bottom faces are then removed, and then reconnected to the two original shapes.
Note: However, if the two parts are twisted, triangles instead of quads will be created in between.
I wanted to share a more elaborate version of quellenform's original answer, where even with a random vertex order, you can achieve a perfect bridge.
The way I did this is by converting the selected loops to curves, (then back to a mesh for extrusion) so that it reorders itself automatically. You can also reverse one of the loops if the faces are intersecting, and even offset the order too.
I added a few other options if you're interested.
Note : The Sample Index
node is called Transfer Attribute
in Index
mode in Blender 3.1.2, this was done in 3.4)