mirror of
https://github.com/jhasse/poly2tri.git
synced 2024-11-26 15:26:12 +01:00
updated triangle
This commit is contained in:
parent
2db07fc4be
commit
0e5724ed3f
@ -54,7 +54,7 @@ class AFront(iTriangle: Triangle) {
|
||||
throw new Exception("Advancing front error")
|
||||
}
|
||||
|
||||
def +=(tuple: Tuple3[Point, Triangle, Node]) = {
|
||||
def insert(tuple: Tuple3[Point, Triangle, Node]) = {
|
||||
val (point, triangle, nNode) = tuple
|
||||
val node = new Node(point, triangle)
|
||||
// Update pointer
|
||||
|
@ -59,6 +59,15 @@ class Triangle(val points: Array[Point], val neighbors: Array[Triangle]) {
|
||||
neighbors(2) = triangle
|
||||
}
|
||||
|
||||
def oppositePoint(t: Triangle) = {
|
||||
if(points(0) == t.points(1))
|
||||
points(1)
|
||||
else if(points(0) == t.points(2))
|
||||
points(2)
|
||||
else
|
||||
points(0)
|
||||
}
|
||||
|
||||
// Fast point in triangle test
|
||||
def pointIn(point: Point): Boolean = {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user