Reputation: 28064
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?
Upvotes: 1
Views: 597
Reputation: 80072
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)
Upvotes: 1