checkpoint
[anneal.git] / src / edu / berkeley / qfat / Mesh.java
index 2441057..747599c 100644 (file)
@@ -240,7 +240,16 @@ public class Mesh implements Iterable<Mesh.T> {
             } while(e != this.e);
 
             // FIXME: intersection test needed?
-            return true;
+            boolean good = true;
+            for(T t : Mesh.this) {
+                if (!good) break;
+                e = this.e;
+                do {
+                    if (!t.has(e.p1) && !t.has(e.p2) && e.t != null && e.intersects(t)) { good = false; break; }
+                    e = e.pair.next;
+                } while(e != this.e);
+            }
+            return good;
         }
 
         public boolean move(Vec v) {