fixed edge bug

This commit is contained in:
zzzzrrr 2009-08-12 16:26:40 -04:00
parent 14980edabe
commit 316ab15839
2 changed files with 4 additions and 6 deletions

View File

@ -272,12 +272,10 @@ class CDT(val points: List[Point], val segments: List[Segment], iTriangle: Trian
nTriangles += node.triangle nTriangles += node.triangle
node = node.next node = node.next
} }
val endPoints = if(ahead) List(point2, point1) else List(point1, point2)
// Triangulate empty areas. // Triangulate empty areas.
val T = new ArrayBuffer[Triangle] val T = new ArrayBuffer[Triangle]
triangulate(points.toArray, endPoints, T) triangulate(points.toArray, List(edge.q, edge.p), T)
// Update advancing front // Update advancing front

View File

@ -294,7 +294,7 @@ class Triangle(val points: Array[Point]) {
i match { i match {
case 0 => if(neighbors(0) != null) neighbors(0).markEdge(points(1), points(2)) case 0 => if(neighbors(0) != null) neighbors(0).markEdge(points(1), points(2))
case 1 => if(neighbors(1) != null) neighbors(1).markEdge(points(0), points(2)) case 1 => if(neighbors(1) != null) neighbors(1).markEdge(points(0), points(2))
case _ => if(neighbors(2) != null) neighbors(2).markEdge(points(0), points(1)) case 2 => if(neighbors(2) != null) neighbors(2).markEdge(points(0), points(1))
} }
} }
@ -304,7 +304,7 @@ class Triangle(val points: Array[Point]) {
i match { i match {
case 0 => triangle.markEdge(points(1), points(2)) case 0 => triangle.markEdge(points(1), points(2))
case 1 => triangle.markEdge(points(0), points(2)) case 1 => triangle.markEdge(points(0), points(2))
case _ => triangle.markEdge(points(0), points(1)) case 2 => triangle.markEdge(points(0), points(1))
} }
} }