0
$\begingroup$

I have some geometry edges and at each vertex that's linked to two edges I want an instance of an object and I want these instances to be oriented between the edges. On the left is an example of the desired result and on the right is where I'm stuck:

enter image description here

In theory I should get two adjusting vectors for each point, find their dot product and then arccos the result. In practice I guess something in my tree isn't doing that.

My GN tree:

enter image description here

and my scene:

$\endgroup$

1 Answer 1

2
$\begingroup$

If you convert your edge-only mesh to a poly-curve, the vertices have an order forced on them, and the X orientation at the control-points bisects the angle between the edges, so that bit is done for you.

What's left is to determine whether the acute angle between the edge-directions entering and leaving each control-point is clockwise or anticlockwise, so we know which instances to flip.

This can be found by detecting whether the cross-product of those vectors is 'up' or 'down' with respect to a given normal, by the right-hand rule. Here the given normal is (0,0,1):

enter image description here

The group also uses the Offset Point in Curve's 'Is Valid' output to filter out end-points. It can be used thus:

enter image description here

.. to give your oriented instances:

enter image description here

$\endgroup$
1
  • $\begingroup$ ooooh I didn't think of that, using a curve and Rotation attribute. Awesome — thank you for the solution and the file ! $\endgroup$ Commented Apr 3, 2023 at 9:29

You must log in to answer this question.

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