A compound path from 2D triangles

Hello,

There are many 2D traingles overlapped/intersected each other, and there are even holes among them, could anyone pointer me some algorithms or documents/libary to get the compound path or clipping paths from these 2D trangles? Thanks!