mirror of
https://github.com/jhasse/poly2tri.git
synced 2024-12-29 06:03:31 +01:00
bug hunting
This commit is contained in:
parent
41e40241a1
commit
00b91269b1
@ -87,7 +87,7 @@ class Poly2TriDemo extends BasicGame("Poly2Tri") {
|
|||||||
val i18 = "data/i.18"
|
val i18 = "data/i.18"
|
||||||
val tank = "data/tank.dat"
|
val tank = "data/tank.dat"
|
||||||
|
|
||||||
var currentModel = star
|
var currentModel = strange
|
||||||
var doCDT = true
|
var doCDT = true
|
||||||
|
|
||||||
var mouseButton = 0
|
var mouseButton = 0
|
||||||
|
@ -134,7 +134,6 @@ class CDT(val points: List[Point], val segments: List[Segment], iTriangle: Trian
|
|||||||
if(i == CDT.clearPoint) {cleanTri = node.triangle; mesh.debug += cleanTri}
|
if(i == CDT.clearPoint) {cleanTri = node.triangle; mesh.debug += cleanTri}
|
||||||
// Process edge events
|
// Process edge events
|
||||||
point.edges.foreach(e => edgeEvent(e, node))
|
point.edges.foreach(e => edgeEvent(e, node))
|
||||||
|
|
||||||
} catch {
|
} catch {
|
||||||
case e: Exception =>
|
case e: Exception =>
|
||||||
//throw new Exception("Suspect point = " + i)
|
//throw new Exception("Suspect point = " + i)
|
||||||
@ -184,9 +183,13 @@ class CDT(val points: List[Point], val segments: List[Segment], iTriangle: Trian
|
|||||||
val tList = new ArrayBuffer[Triangle]
|
val tList = new ArrayBuffer[Triangle]
|
||||||
tList += firstTriangle
|
tList += firstTriangle
|
||||||
|
|
||||||
while(!tList.last.contains(edge.p))
|
// Not sure why tList.last is null sometimes....
|
||||||
|
while(tList.last != null && !tList.last.contains(edge.p))
|
||||||
tList += tList.last.findNeighbor(edge.p - edge.q)
|
tList += tList.last.findNeighbor(edge.p - edge.q)
|
||||||
|
|
||||||
|
if(tList.last == null)
|
||||||
|
tList -= tList.last
|
||||||
|
|
||||||
// Neighbor triangles
|
// Neighbor triangles
|
||||||
val nTriangles = new ArrayBuffer[Triangle]
|
val nTriangles = new ArrayBuffer[Triangle]
|
||||||
|
|
||||||
@ -239,9 +242,6 @@ class CDT(val points: List[Point], val segments: List[Segment], iTriangle: Trian
|
|||||||
|
|
||||||
aFront.constrainedEdge(sNode, eNode, T1, T2, edge)
|
aFront.constrainedEdge(sNode, eNode, T1, T2, edge)
|
||||||
|
|
||||||
// Mark edge triangle neighbors
|
|
||||||
//T1.foreach(t => t.markNeighbor(eTri))
|
|
||||||
|
|
||||||
} else if(firstTriangle == null) {
|
} else if(firstTriangle == null) {
|
||||||
|
|
||||||
// No triangles are intersected by the edge; edge must lie outside the mesh
|
// No triangles are intersected by the edge; edge must lie outside the mesh
|
||||||
|
Loading…
Reference in New Issue
Block a user