static void print_triangles cardinal edge e_start next point index poi

 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
static void print_triangles(cardinal n)
{
edge *e_start, *e, *next;
point *u, *v, *w;
index i;
point *t;
for (i = 0; i < n; i++) {
u = &p_array[i];
e_start = e = u->entry_pt;
do
{
v = Other_point(e, u);
if (u < v) {
next = Next(e, u);
w = Other_point(next, u);
if (u < w)
if (Identical_refs(Next(next, w), Prev(e, v))) {
/* Triangle. */
if (v > w) { t = v; v = w; w = t; }
if (printf("%d %d %d\n", u - p_array, v - p_array, w - p_array) == EOF)
panic("Error printing results\n");
}
}
/* Next edge around u. */
e = Next(e, u);
} while (!Identical_refs(e, e_start));
}