0
$\begingroup$

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: Loop Setup for Pole and Wall Generation Object and loop initialization: Objects Setup Current State. I want the walls rotation to follow the edges. Current State

$\endgroup$

1 Answer 1

1
$\begingroup$

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 <e1, e2> of the edge, the angle is given by atan2 (arctangent B/A in Nodes) from x, y componants of <e1, e2>.

Note: in the nodes below, have used iterations on object and edges instead of by index access.

enter image description here

enter image description here

$\endgroup$
1
  • $\begingroup$ Hey Lemon, Thanks alot! That did it. Have a nice Day! =D $\endgroup$
    – Aarree
    Sep 19, 2020 at 11:40

You must log in to answer this question.

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