Let's say we have an edge with 2 vertices, v1 and v2. If I am in v1 I want the vector (v1, v2). If I am in v2, I want (v2, v1) (the opposite).
I have found some strange results in Blender, which means it is a bug or I am missing something. It is usually the second case, but here it is the case:
In the picture there are 3 vertices: A (-1,1,0), B(1,1,0) and C (1,-1,0). They are orthogonally connected: A - B - C.
I take the geometry and do split edges, so vertex B is duplicated, having: A - B , B' - C. Now I make use of Edge Vertices node to find out the other vertex in the pair. Two things happens:
- Store Named Attribute node does not save the vertex 2 index. It is always 0
- I marked with a red square in the picture. The vertex B (index 2), see himself as the other vertex in the edge, but the subtraction (= direction vector) seems to be correct.
I strongly suspect Blender is using the original Mesh when running Edge Vertices rather than the "split edge mesh".
So, is there any way to solve point 1 and 2?
Is there a better way to compute the direction I am looking forward? In a more complex case it is not correctly computed, but I could not find the minimal case to reproduce it.
Thanks in advance!
==============
As Robin Betts suggested:
It does not make any sense to me. It is the same problem I got with my solution.
========
Just for those with curiosity, here is the blender file