Question

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)?

intersecting triangle sets

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?

Was it helpful?

Solution

Freeware Clipper library is worth mentioning. It is rather fast and stable.

There are links to third party Perl, Ruby and Haskell modules (inside the distributive)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top