1
$\begingroup$

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:

enter image description here

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:

  1. Store Named Attribute node does not save the vertex 2 index. It is always 0
  2. 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:

enter image description here

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

$\endgroup$

2 Answers 2

5
$\begingroup$

Personally, I think I'd want to be sure that whatever problem I was solving this way couldn't be solved more generally, purely in the Edge domain? The edge-end indices don't exist in the Vertex domain, so will evaluate as 0.

But in the special case of separated edges in an edge-only mesh, it seems the explicit (1-value) interpolation from Edge domain to Vertex domain works:

enter image description here

So, for example, you can make instances on extruded edges like this:

enter image description here

$\endgroup$
5
  • $\begingroup$ Thank you for your reply! I was using Blender 3.2 and the Interpolate Domain node does not exists in that version. Unfortunately your solution does not work in all cases. If you create a plane and delete 3 edges, you will end up with the arrows looking in the same direction. I find out how to post and screenshot $\endgroup$
    – ditiem
    Commented Oct 22, 2022 at 3:14
  • $\begingroup$ Hi. @ditiem ! I'm pretty sure I went through a version using Accumulate Field on the edge domain. If it needs to be 3.2, I'll check that out. I tried reproducing the fail. I haven't managed yet. Are you sure there are no faces left, or something? $\endgroup$
    – Robin Betts
    Commented Oct 22, 2022 at 6:55
  • 1
    $\begingroup$ Hi Robin!. I am sure no rare things are there. I have shared the file, you can have a look with your own eyes. I have added another segment, same problem. I have noticed that if I invert the condition when computing the subtraction of the vectors nothing happens. It is like Blender will not execute those nodes if there is only 1 edge. $\endgroup$
    – ditiem
    Commented Oct 23, 2022 at 3:52
  • 1
    $\begingroup$ @ditiem Hi again! The inverse of an Euler rotation is not that rotation with its angles negated, which is what Blender seems to be doing, given a 'Fac' of -1. So the 'Fac' input to the Align Euler node does not work, here. $\endgroup$
    – Robin Betts
    Commented Oct 23, 2022 at 8:22
  • 1
    $\begingroup$ You are right!!! I will upload the file in the same link just in case someone find it useful in the future. Super mega thank you for everything! If I publish something I will put you in the credits for sure. $\endgroup$
    – ditiem
    Commented Oct 23, 2022 at 13:24
0
$\begingroup$

Robin Betts' solution has been true salvation for me. I tested it made some discovers and small modifications.

First of all, as you can see, the Node Tree (unchanged) outputs different results depending on the geometry. My goal was to create a geodesic dome with procedural structural parts. Though, to achieve the desired result, with Robin's Note Tree I had to remove faces from the mesh in Edit Mode.

On the left, in fact, you can see the result with the original geometry.

It is not clear to me why this is happening. I have, at least, two doubts:

  1. On the left mesh (the working one) Split Edges node seems to work properly but there is no face anymore, so, what connected geometry elements is it splitting? Vertices? It is not what Blender documentation claims.

Like the Edge Split Modifier, the Split Edges node splits and duplicates edges within a mesh, breaking ‘links’ between faces around those split edges.

  1. What went wrong with the left mesh? The Rotation passed in to the Instance on Points node, after all, is a quantity derived from the operation which members are the positions of the vertices of each edge. But observing the unexpected result it looks like the Edge Vertices node is (somehow) "out of scope" in this particular context.

enter image description here

Finally, I added two improvements to Robin's Node Tree (one of which I am not sure is required).

  1. I added a basic scale operation such that the arrows fill the entire edge length.
  2. I added a Vector Math node with Normalize operation applied to the rotation vector.

This is the link with the file (I am using GDrive because blend-exchange.com seems to take eons to upload).

https://drive.google.com/file/d/11W8NQLgH1OAJ1_-hfDsh4je_Sk4bar8N/view?usp=sharing

$\endgroup$
2
  • $\begingroup$ Hello and welcome to Blender.SE! Is this an answer to the above question, or is this a new question? $\endgroup$
    – quellenform
    Commented May 23, 2023 at 13:10
  • 1
    $\begingroup$ My purpose was to contribute adding more research to the topic. For example contributing with the discovery that the Robin's solution seems to behave in an unexpected way if applied to a mesh that has faces. $\endgroup$ Commented May 24, 2023 at 4:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .