title: split triangles on overlap
body: <p>I have a triangle (red, below).   <em>(or a 2D mesh of triangles)</em></p>
  
  <p>How can I compute the polygons (and in turn tessellate them) that result from subtracting a second triangle (green) from the first?</p>
  
  <p><img src="https://i.stack.imgur.com/Xe2hC.gif" alt="enter image description here"></p>
  
  <p>(I'm using Python and I'm looking for an explanation and pseudo-code of an approach I can take, rather than recommendations for opaque libraries.  (I currently use <a href="http://pyopengl.sourceforge.net/documentation/manual/gluTessBeginPolygon.3G.xml" rel="nofollow noreferrer"><code>gluTess*()</code></a> to do the tessellation of polygons, but an explanation of how to do the tesselltation myself would be interesting; my pressing problem is really the Boolean operation itself though.)   It will be exciting to learn and understand the solution.  My triangles are always counter-clockwise winding, if that makes any difference.)</p>