1 |
< |
/* Copyright (c) 1991 Regents of the University of California */ |
1 |
> |
/* Copyright (c) 1995 Regents of the University of California */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
27 |
|
* The last vertex is automatically connected to the first. |
28 |
|
*/ |
29 |
|
|
30 |
+ |
#ifdef SMLFLT |
31 |
+ |
#define VERTEPS 1e-2 /* allowed vertex error */ |
32 |
+ |
#else |
33 |
|
#define VERTEPS 1e-4 /* allowed vertex error */ |
34 |
+ |
#endif |
35 |
|
|
36 |
|
|
37 |
|
FACE * |
38 |
|
getface(o) /* get arguments for a face */ |
39 |
|
OBJREC *o; |
40 |
|
{ |
37 |
– |
double fabs(); |
41 |
|
double d1; |
42 |
|
int badvert; |
43 |
|
FVECT v1, v2, v3; |
58 |
|
|
59 |
|
f->va = o->oargs.farg; |
60 |
|
f->nv = o->oargs.nfargs / 3; |
61 |
+ |
/* check for last==first */ |
62 |
+ |
if (dist2(VERTEX(f,0),VERTEX(f,f->nv-1)) <= FTINY*FTINY) |
63 |
+ |
f->nv--; |
64 |
|
/* compute area and normal */ |
65 |
|
f->norm[0] = f->norm[1] = f->norm[2] = 0.0; |
66 |
|
v1[0] = v1[1] = v1[2] = 0.0; |
119 |
|
int ncross, n; |
120 |
|
double x, y; |
121 |
|
register int xi, yi; |
122 |
< |
register double *p0, *p1; |
122 |
> |
register FLOAT *p0, *p1; |
123 |
|
|
124 |
|
xi = (f->ax+1)%3; |
125 |
|
yi = (f->ax+2)%3; |