| 274 |
|
int |
| 275 |
|
main(int argc, char *argv[]) |
| 276 |
|
{ |
| 277 |
+ |
int smooth = 0; |
| 278 |
|
int nsegs = 1; |
| 279 |
|
int objout = 0; |
| 280 |
|
int i; |
| 302 |
|
case 'i': /* invert surface normals */ |
| 303 |
|
rev = 1; |
| 304 |
|
break; |
| 305 |
+ |
case 's': /* normal smoothing? */ |
| 306 |
+ |
smooth = 1; |
| 307 |
+ |
break; |
| 308 |
|
case 'r': /* rounded edges/corners */ |
| 309 |
|
rounde = 1; |
| 310 |
|
/* fall through */ |
| 401 |
|
side(6, 4, 5, 7); |
| 402 |
|
} |
| 403 |
|
if (obj != NULL) { /* need to write output? */ |
| 404 |
+ |
if (!smooth) |
| 405 |
+ |
removeNormals(obj, 0, 0); |
| 406 |
|
if (objout) { |
| 407 |
< |
coalesceVertices(obj, 2.*FTINY); |
| 407 |
> |
if (rounde) /* joins corners to edges */ |
| 408 |
> |
coalesceVertices(obj, 2.*FTINY); |
| 409 |
|
if (toOBJ(obj, stdout) <= 0) |
| 410 |
|
return(1); |
| 411 |
|
} else if (toRadiance(obj, stdout, 0, 0) <= 0) |
| 416 |
|
userr: |
| 417 |
|
fprintf(stderr, "Usage: %s ", argv[0]); |
| 418 |
|
fprintf(stderr, "material name xsize ysize zsize "); |
| 419 |
< |
fprintf(stderr, "[-i] [-b bevel | -r round [-n nsegs]] [-o]\n"); |
| 419 |
> |
fprintf(stderr, "[-i] [-b bevel | -r round [-n nsegs][-s]] [-o]\n"); |
| 420 |
|
return(1); |
| 421 |
|
} |