Calculating XYZ Euler rotation values for arbitrary plane

I’ll find a solution for that. Generally it won’t always be the minimal bounding box solution, since in my case I want to align terrain with hexagons on my surface in a certain manner, because for each possible selection of faces I’ll have a different terrain model.

The only difficulty I see there right now is orientation, since my surface is spherical. So I guess to know what’s to the “right”, “left”, “below” and “above” I’ll probably have to convert 3d coordinates to longitude/latitude.