# How to calculate overall area of multipy meshes that overlap itself

I have few meshes in Unity that are sometimes overlap / intersect.

These meshes are flat (z=0). It can be 3 situation like on picture below. Each time I want to calculate overall area (marked black color on the picture)

I think that it can be done based on calculate area taking only outer points of combined mesh? Does anyone can provide any example on idea how to do it?

## Answers

I can point you to Weiler-Atherton clipping algorithm here and a C++ implementation here

Another alternative (but more time consuming I think) method would be the following:

- Triangulate your polygons (harder part) and mark them with the label of the original polygon
- Compute the list of intersection between all triangles (much easier since you just have to intersect 2 triangles)
- Compute the area of triangles intersected with different labels => the needed output