title: Fast Boolean Operation Between Two Groups Of Meshes
body: <p>This is a trimmed down question of <a href="https://stackoverflow.com/questions/4584704/the-algorithm-to-overlay-of-two-mesh-systems">this question</a>. Basically I'm just asking about the No. 1 in the question. </p>
  
  <p>Let's say I have two groups of <a href="http://en.wikipedia.org/wiki/Polygon_mesh" rel="nofollow noreferrer">meshes</a>, The definition of the mesh class is as follows ( C# syntax):</p>
  
  <pre><code>public class Mesh
  {
   public List&lt;Element&gt; elements;
   public List&lt;Point&gt; points;
  }
  
  public class Element
  {
    public List&lt;int&gt; PointIndex;
  }
  
  public class Point
  {
    public double X;
    public double Y;
  }
  </code></pre>
  
  <p>Is there any efficient way/ implementation to find the resulting of boolean operations ( in my case I would like to find the <strong>polygonal-style intersection</strong>) between two <code>Mesh</code>s?</p>
  
  <p>The naive way would be to loop through all the <code>Element</code>s inside the <code>Mesh</code> object, check against other <code>Element</code> in another <code>Mesh</code> object, and obtain the results.</p>
  
  <p>But I believe there are more efficient algorithm to do this-- <a href="http://en.wikipedia.org/wiki/Sweep_line_algorithm" rel="nofollow noreferrer">utilizing plane sweeping algorithm</a>. </p>
  
  <p>It would be greater if such algorithm is already implemented elsewhere, either in .Net, C++ or matlab.</p>