5 ngons {number of vertices to each polygon}
7 [p1,p2,p3,p4,p5,p6,....]
13 #define ZVAL(pts,verti,i) (pts)[3*verti[i]+2]
15 static int n_vertices;
16 static double *pt_array;
18 static int pt_compare(p,q)
20 { double m = ZVAL(pt_array,p,n_vertices) - ZVAL(pt_array,q,n_vertices);
21 return (m < 0.0 ? -1 : m > 0.0 ? 1 : 0);
26 sort_ngons(pts,vertex,ngons)
30 sort_ngons1(pts->lfa.lfa_self,vertex->ust.ust_self,ngons,
31 (vertex->ust.ust_fillp)/(ngons+1));
37 sort_ngons1(pts,vertex,ngons,number_ngons)
40 int ngons,number_ngons;
44 for (i=0; i < number_ngons ; i++) {
45 { short * maxz_at = p;
48 if (ZVAL(pts,p,n) > ZVAL(pts,maxz_at,0))
50 p[ngons] = maxz_at[0];
55 qsort(vertex,number_ngons,sizeof(short)*(ngons+1),pt_compare);