mirror of
https://github.com/jhasse/poly2tri.git
synced 2024-12-31 23:23:30 +01:00
added comments
This commit is contained in:
parent
19e6c4208f
commit
552b5a76b8
@ -209,7 +209,8 @@ class CDT(val points: List[Point], val segments: List[Segment], iTriangle: Trian
|
|||||||
while(triangles.last != null && !triangles.last.contains(edge.p))
|
while(triangles.last != null && !triangles.last.contains(edge.p))
|
||||||
triangles += triangles.last.findNeighbor(edge.p - edge.q)
|
triangles += triangles.last.findNeighbor(edge.p - edge.q)
|
||||||
|
|
||||||
// TODO: triangles.last == null bug!
|
// TODO: fix triangles.last == null bug!
|
||||||
|
// This happens in the bird demo...
|
||||||
if(triangles.last == null)
|
if(triangles.last == null)
|
||||||
triangles -= triangles.last
|
triangles -= triangles.last
|
||||||
|
|
||||||
@ -228,10 +229,12 @@ class CDT(val points: List[Point], val segments: List[Segment], iTriangle: Trian
|
|||||||
t.points.foreach(p => {
|
t.points.foreach(p => {
|
||||||
if(p != edge.q && p != edge.p) {
|
if(p != edge.q && p != edge.p) {
|
||||||
if(t.orient(point1, point2, p) >= 0 ) {
|
if(t.orient(point1, point2, p) >= 0 ) {
|
||||||
|
// Keep duplicate points out
|
||||||
if(!lPoints.contains(p)) {
|
if(!lPoints.contains(p)) {
|
||||||
lPoints += p
|
lPoints += p
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// Keep duplicate points out
|
||||||
if(!rPoints.contains(p))
|
if(!rPoints.contains(p))
|
||||||
rPoints += p
|
rPoints += p
|
||||||
}
|
}
|
||||||
@ -267,6 +270,8 @@ class CDT(val points: List[Point], val segments: List[Segment], iTriangle: Trian
|
|||||||
// STEP 3: Triangulate empty areas.
|
// STEP 3: Triangulate empty areas.
|
||||||
triangulateEmpty(point1, point2, points)
|
triangulateEmpty(point1, point2, points)
|
||||||
|
|
||||||
|
// TODO: Update AFront before pushing changes!!!!!
|
||||||
|
|
||||||
// TODO: Update Delauney Edge Pointers
|
// TODO: Update Delauney Edge Pointers
|
||||||
|
|
||||||
} else if(firstTriangle.contains(edge)) {
|
} else if(firstTriangle.contains(edge)) {
|
||||||
|
@ -38,14 +38,7 @@ class Mesh(initialTriangle: Triangle) {
|
|||||||
|
|
||||||
// Triangles that constitute the mesh
|
// Triangles that constitute the mesh
|
||||||
val map = HashSet(initialTriangle)
|
val map = HashSet(initialTriangle)
|
||||||
|
// Debug triangles
|
||||||
val debug = HashSet.empty[Triangle]
|
val debug = HashSet.empty[Triangle]
|
||||||
|
|
||||||
def addEdge(point:Point, triangle: Triangle) {
|
|
||||||
/*
|
|
||||||
val p = point.eEvent.p
|
|
||||||
if(!triangle.contains(p)) {
|
|
||||||
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user