Calculate 2D Areas from 3D Projection

994 Views Asked by At

Suppose I have 13 vertices representing coordinates of a cube and tetrahedron in 3D space (i.e. blue dots in the image below), and 4 vertices representing a plane in 3D space (i.e. green dots in the image below).

How can I 'project' the 3D data onto the 2D plane, such that I am able to calculate the areas of 2D shapes 1-6?

Note that since the tetrahedron is 'in front' of the cube, area 3 will need to take into account that some of its area is being 'shaded' by the tetrahedron.

In other words, if the 2D plane is a parallel light source shining towards the objects, areas 1-6 in the 2D image represent the geometry of areas which are 'lit' by the light source. Or as another analogy, if the faces of the 3D objects are solar panels to capture energy from the sun, the 2D areas 1-6 represent the 'amount of sunlight captured' by each face.

I imagine solving this would consist of 3 parts:

  1. Convert 3D coordinates to 2D coordinates
  2. Test for depth (to determine if an object is 'in front' of another object)
  3. Calculate areas of shapes 1-6

I believe part 3 might be solvable by breaking each 2D shape into triangles (is there an algorithm to do this?), then using this formula to calculate the area of each triangle. For example shape 1 could be split into 2 triangles, while shape 3 can be split into 5 triangles.

However I have no idea how to solve steps 1 and 2, and if the strategy above is even the right approach. Also note there are 2 objects in this example (cube + tetrahedron), however I'd like to be able to calculate the 2D projected areas for any number of objects in a 3D space.

Any ideas would be much appreciated.

enter image description here