Given two sets of triangles where the triangles in each set don't overlap but may share 1 or 2 points, what's the best way to calculate the area resulting from the intersection of both triangle sets (violet areas in image)?
Is this a hard or a trivial problem? Are there existing libraries that would calculate the area for me (preferably in a scripting language like Python, Ruby or JavaScript)? If there is no library, what's the math behind it?