Align object to edge | "Fence-generator" I want to build a 'Fence-Generator'. For that i did simple path from points connected with edges.
What i did so far:
Aligned fence-poles to verticies and fences-walls to edge centers. but now i want the rotation of fences-walls to match the rotation of the edges.
I tried to calculate the angle but i didn't got it to work.
Any help on how i can calculate the right rotation for the wall would really be appreciated!
Loop Setup for Pole and Wall Generation:

Object and loop initialization:

Current State. I want the walls rotation to follow the edges.
Presuming the base wall object is aligned along X and long 1 unit.
You can have the angle using the angle from the edge to X axis.
So if you have the vector &lt;e1, e2&gt; of the edge, the angle is given by atan2 (arctangent B/A in Nodes) from x, y componants of &lt;e1, e2&gt;.
Note: in the nodes below, have used iterations on object and edges instead of by index access.