I’m trying to do some animation/physics sim based on geometry nodes and searched far and wide for possible solutions, yet keep returning to the same issue.
How can I find the “other vertex” of an edge? As far as I understand, most nodes (store named attribute, named attribute, set position) work on a “foreach vertex/point” principle. So in this case, i’m retrieving the edge-0 of this vertex, then fetch the vertices of this edge and compare which one is the same as I’m currently on and return the “other” vertex.
I tried different versions of “evaluate on domain” or something, but nothing worked.
Assuming a field in geonodes is evaluated based on a stored “current vertex/current face / current edge” reference, how can one access that, especially when accessing the parent face / parent vertex or child-vertices etc.? The Attribute “index” might have different meanings in subparts of a field.
Related question: how to get proper feedback to the developers? Does blender have dedicated ticketing where these things are funneled into? I have a few cases where the “unclear if vertex/face/edge” nature of fields gets problematic and would like to give constructive feedback
Thanks
Go read this. It is the bare minimum you have to grasp to start using GN properly.
Only once you’ve read it you can continue reading what comes next.
Since you are evaluating against an Edge (From the Sampling node), all fields will be in the Edge domain. So all indices will be edge indices (i.e. they are all mislabeled in your diagram).
Edit: Correction: The Index field is evaluated from the calling context (i.e. Point… shown as blue line), but the Value is evaluated from the resolving context… (i.e. Edge… shown as the orange line)
Have a look at the results for above network in the spreadsheet for it to make sense.
This is what you want:
Note that Edges of Vertices will assume vertex index input so you don’t need to connect an index node to it.
Also note that operating in edges in the point domain is probably not what you want to be doing… since many edges can connect to one vert you may just want to operate in the edge domain exclusively and you’ll not run into this problem… could be your problem needs re-stating.
Good luck.
7 Likes
Thanks very much. Having “index” and “value” solved in different domains means I have to create bunch of workarounds again but at least I know why this is happening now.
Bit of Background: I’m trying to do some physics-sim, using edges as constraints. Therefore sampling all neighbors, storing indices and distance. Of course every vertex can have [n] edges/constraints.
With a programming background the natural approach would be
foreach point
- get edges per point
- foreach edge
-
-
- find “other” point (point where index != current index)
-
- save reference/attribute…
Working with genodes since the first alpha/beta I partially like that they don’t need loops all the time, yet this leads to limitations and very unclear situations where you have trace every connector and technically “easy” things become very complicated.
I do not understand why these aren’t a bit closer to coding languages, after all, all these issues came up there years ago and solutions were found.
Probably having all nodes work with index-input and have control over which domain this is done in (edge, vertex, face etc.) would make this much more user friendly.
But as soon as I want to use both indexes like attribute “bla” I need “both” and I’m back with explicit loops.
… using a repeatzone to actually navigate each vertex/edge properly is a bad idea right now, right?
(Trying to explain geonodes to some friends/coworkers, and they just don’t want to use them, hoping this gets clearer in the future)
Thanks a lot, maybe I’ll post the result as soon as it works here.
Got it to work. Sampling Neighbor-Vertices no matter where they are in space.
Using the IDs to sample distances and then using the edges as deformation-constraints. So far, I used up to 4 constraints for a simplified cloth-sim.
5 Likes
Well done.
Note you can simplify your network by getting rid of one of the Edges of Vertices nodes. You don’t need 2 of them.
Good work.
1 Like