ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/face.c
(Generate patch)

Comparing ray/src/common/face.c (file contents):
Revision 1.3 by greg, Fri Jul 28 14:27:44 1989 UTC vs.
Revision 2.3 by greg, Fri May 14 13:42:53 1993 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1986 Regents of the University of California */
1 > /* Copyright (c) 1991 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 27 | Line 27 | 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;
# Line 84 | Line 87 | OBJREC  *o;
87                  badvert += fabs(d1 - f->offset/i) > VERTEPS;
88                  f->offset += d1;
89          }
90 <        f->offset /= f->nv;
90 >        f->offset /= (double)f->nv;
91          if (badvert)
92                  objerror(o, WARNING, "non-planar vertex");
93                                                  /* find axis */
# Line 99 | Line 102 | OBJREC  *o;
102   freeface(o)                     /* free memory associated with face */
103   OBJREC  *o;
104   {
105 +        if (o->os == NULL)
106 +                return;
107          free(o->os);
108          o->os = NULL;
109   }
# Line 111 | Line 116 | FACE  *f;
116          int  ncross, n;
117          double  x, y;
118          register int  xi, yi;
119 <        register double  *p0, *p1;
119 >        register FLOAT  *p0, *p1;
120  
121          xi = (f->ax+1)%3;
122          yi = (f->ax+2)%3;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines