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"; |
51 |
|
if (o->oargs.nfargs < 9 || o->oargs.nfargs % 3) |
52 |
|
objerror(o, USER, "bad # arguments"); |
53 |
|
|
54 |
+ |
o->os = (char *)f; /* save face */ |
55 |
+ |
|
56 |
|
f->va = o->oargs.farg; |
57 |
|
f->nv = o->oargs.nfargs / 3; |
58 |
|
/* compute area and normal */ |
84 |
|
badvert += fabs(d1 - f->offset/i) > VERTEPS; |
85 |
|
f->offset += d1; |
86 |
|
} |
87 |
< |
f->offset /= f->nv; |
87 |
> |
f->offset /= (double)f->nv; |
88 |
|
if (badvert) |
89 |
|
objerror(o, WARNING, "non-planar vertex"); |
90 |
|
/* find axis */ |
92 |
|
if (fabs(f->norm[2]) > fabs(f->norm[f->ax])) |
93 |
|
f->ax = 2; |
94 |
|
|
93 |
– |
o->os = (char *)f; /* save face */ |
95 |
|
return(f); |
96 |
|
} |
97 |
|
|
99 |
|
freeface(o) /* free memory associated with face */ |
100 |
|
OBJREC *o; |
101 |
|
{ |
102 |
+ |
if (o->os == NULL) |
103 |
+ |
return; |
104 |
|
free(o->os); |
105 |
|
o->os = NULL; |
106 |
|
} |