0
$\begingroup$

Calculate the angle between two edges using geometry nodes.

How can I calculate the angle between two edges using geometry nodes.

img1

When I try and calculate it, it says 90 degrees (see red arrow which is not correct) what am I missing?

img2

$\endgroup$

2 Answers 2

2
$\begingroup$

Your second Sample Index node samples an edge with index 1 — the second edge (0 being the first). But mesh line with 2 points only has 1 edge, so the output of this node is a null vector.

enter image description here

Changing the Sample Index to 0 will fix the issue

enter image description here

$\endgroup$
3
$\begingroup$

I think Sergey Kritskiy has answered why your group isn't working, and adjusted accordingly.

If it helps, this is a group using the same method as yours, with a little more generality.

  • Curves don't branch, and have a vertex index order imposed, so the mesh is converted for calculation.
  • The minimum swept angle between incoming and outgoing edge-directions is returned on each vertex, marked positive anticlockwise, with respect to a given 'Up' viewing direction.

enter image description here

It takes the Arccosine of the dot-product of the normalized directions, and derives the sign of the angle from the alignment of their cross-product with 'Up'. The cross-product is 0-length at end-points, so 0° is returned for those.

$\endgroup$

You must log in to answer this question.

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