I am currently trying to make a "castle generator" using geometry nodes. I have succesfully put the cubes on the right edges, but their rotation is not according to the edges direction. This is how it looks now, you can see the wrong rotations on edges that are not 90 degrees. Does anybody know, how I could rotate them in the direction of the edge? This is my node setup. The nodes on left decide if the edge is on top of the "castle", or its side / down.
EDIT: Here is new node system and result. Is there anything I could change for it to work properly?