private void flipCorner int println will check for flip corner vertice

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
private void flipCorner(int c) {
//println("will check for flip corner: " + vertices.get((Integer)corners.get(c)));
//no opposite vertex
if (c == BOUND) {
return;
}
//compute triplets
buildTriplets();
//no opposite vertex
if (o(c) == BOUND) {
return;
}
//contains opposite vertex and mesh isn't Delaunay
if (!isDelaunay(c)) {
//println("will flip cuz not Delaunay: " + vertices.get((Integer)corners.get(c)));
int opp = o(c);
//println("change in corners:" + n(c) + " was " + corners.get(n(c)) + " became " + corners.get(opp));
corners.set(n(c), corners.get(opp));
//println("change in corners:" + n(opp) + " was " + corners.get(n(opp)) + " became " + corners.get(c));
corners.set(n(opp), corners.get(c));
//check for neighbor corners
buildTriplets();
flipCorner(c);
buildTriplets();
flipCorner(n(opp));
}
}