RoomPlan: Mapping the walls to the floor

How can one match the walls and floor of a given CapturedRoom ?

The transform.eulerAngles of a floor z & y are always 0 !

And the polygons seems to have a different orientation than the walls. So how to figure out the rotation and match the one from the walls ?

RoomPlan: Mapping the walls to the floor
 
 
Q