How to create a box from 2 planes

I have 2 planes with unknown rotations. They can be in any rotation but I can guarantee they would be parallel to each other. They may not be perfectly parallel (slightly slanted relative to each other), but will never intersect each other. How do I make a box out of the 2 planes?

My brain says just find the coordinates of each side and create a plane for each side. Combine them all and I get a box. But I have no idea how to go about achieving this.

Or is there any other better way to handle this?

You may calculate the coordinates of the 4 vertices of each plane (using localToWorld) – these are 8 points total. Then you can to dress them as a 3D object (using ConvexGeometry).

Because the two planes are not perfectly aligned, the sides of the box will not be planar:

1 Like