| 35 |
|
RREAL (*vtlist)[2]; /* map vertex list */ |
| 36 |
|
int nvts; |
| 37 |
|
|
| 38 |
+ |
int ndegen = 0; /* count of degenerate faces */ |
| 39 |
+ |
|
| 40 |
|
typedef int VNDX[3]; /* vertex index (point,map,normal) */ |
| 41 |
|
|
| 42 |
|
#define CHUNKSIZ 1024 /* vertex allocation chunk size */ |
| 142 |
|
printargs(argc, argv, stdout); |
| 143 |
|
convert(stdin); |
| 144 |
|
} |
| 145 |
+ |
if (ndegen) |
| 146 |
+ |
printf("# %d degenerate faces\n", ndegen); |
| 147 |
|
exit(0); |
| 148 |
|
userr: |
| 149 |
|
fprintf(stderr, "Usage: %s [-o obj][-m mapping][-n][-f] [file.obj]\n", |
| 578 |
|
return(1); |
| 579 |
|
} |
| 580 |
|
if ((cp = getmtl()) == NULL) |
| 581 |
< |
return(-1); |
| 581 |
> |
return(0); |
| 582 |
|
printf("\n%s polygon %s.%d\n", cp, getonm(), faceno); |
| 583 |
|
printf("0\n0\n%d\n", 3*ac); |
| 584 |
|
for (i = 0; i < ac; i++) { |
| 606 |
|
register int i; |
| 607 |
|
|
| 608 |
|
if ((mod = getmtl()) == NULL) |
| 609 |
< |
return(-1); |
| 609 |
> |
return(0); |
| 610 |
|
|
| 611 |
|
if (!cvtndx(v1i, v1) || !cvtndx(v2i, v2) || !cvtndx(v3i, v3)) |
| 612 |
|
return(0); |
| 619 |
|
|
| 620 |
|
switch (flatness) { |
| 621 |
|
case DEGEN: /* zero area */ |
| 622 |
+ |
ndegen++; |
| 623 |
|
return(-1); |
| 624 |
|
case RVFLAT: /* reversed normals, but flat */ |
| 625 |
|
case ISFLAT: /* smoothing unnecessary */ |
| 640 |
|
if (texOK | patOK) |
| 641 |
|
if (comp_baryc(&bvecs, vlist[v1i[0]], vlist[v2i[0]], |
| 642 |
|
vlist[v3i[0]]) < 0) |
| 643 |
< |
return(-1); |
| 643 |
> |
texOK = patOK = 0; |
| 644 |
|
/* put out texture (if any) */ |
| 645 |
|
if (texOK) { |
| 646 |
|
printf("\n%s texfunc %s\n", mod, TEXNAME); |