mirror of
https://github.com/jhasse/poly2tri.git
synced 2024-12-27 21:23:30 +01:00
fixed edge bug
This commit is contained in:
parent
14980edabe
commit
316ab15839
@ -272,12 +272,10 @@ class CDT(val points: List[Point], val segments: List[Segment], iTriangle: Trian
|
||||
nTriangles += node.triangle
|
||||
node = node.next
|
||||
}
|
||||
|
||||
val endPoints = if(ahead) List(point2, point1) else List(point1, point2)
|
||||
|
||||
|
||||
// Triangulate empty areas.
|
||||
val T = new ArrayBuffer[Triangle]
|
||||
triangulate(points.toArray, endPoints, T)
|
||||
triangulate(points.toArray, List(edge.q, edge.p), T)
|
||||
|
||||
// Update advancing front
|
||||
|
||||
|
@ -294,7 +294,7 @@ class Triangle(val points: Array[Point]) {
|
||||
i match {
|
||||
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 _ => 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 {
|
||||
case 0 => triangle.markEdge(points(1), 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))
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user