title: Shapely intersection: parallel planes
body: <p>I'm working on determining relationships (boundary/interior intersections) between two 3D objects (triangular faces) and stumbled on <a href="http://pypi.python.org/pypi/Shapely" rel="nofollow noreferrer">Shapely</a>, which I am interested in using instead of implementing my own point/segment/ray/triangle intersection functions.</p>
  
  <p>However, I'm running into the following problem:</p>
  
  <pre><code>&gt;&gt;&gt; from shapely.geometry import Polygon
  &gt;&gt;&gt; poly = Polygon([(0,1,1),(1,-1,1),(-1,-1,1)])
  &gt;&gt;&gt; poly2 = Polygon([(0,1,0),(1,-1,0),(-1,-1,0)])
  &gt;&gt;&gt; poly.intersects(poly2)
  True
  &gt;&gt;&gt; poly.equals(poly2)
  True
  </code></pre>
  
  <p>The problem I seem to be running into is that the two polygons are equal in their 2D orthogonal projections (same triangle), but in different planes (one's at Z=1, other at Z=0), but Shapely is saying they're equal and intersect.</p>
  
  <p>Is there some magic I'm missing to make shapely think in 3 dimensions?  I've been googling, but every example I've seen so far is only in two dimensions.</p>