6 |
|
*/ |
7 |
|
|
8 |
|
#include "copyright.h" |
9 |
+ |
#include "paths.h" |
10 |
|
#include "platform.h" |
11 |
|
#include "standard.h" |
12 |
|
#include "resolu.h" |
23 |
|
|
24 |
|
int nowarn = 0; /* supress warnings? */ |
25 |
|
|
26 |
< |
int objlim = 15; /* # of objects before split */ |
26 |
> |
int objlim = 9; /* # of objects before split */ |
27 |
|
|
28 |
|
int resolu = 16384; /* octree resolution limit */ |
29 |
|
|
40 |
|
) |
41 |
|
{ |
42 |
|
int nmatf = 0; |
43 |
< |
char *matinp[32]; |
43 |
> |
int verbose = 0; |
44 |
> |
char pathnames[12800]; |
45 |
> |
char *pns = pathnames; |
46 |
> |
char *matinp[128]; |
47 |
> |
char *cp; |
48 |
|
int i, j; |
49 |
|
|
50 |
|
progname = argv[0]; |
61 |
|
case 'a': /* material file */ |
62 |
|
matinp[nmatf++] = argv[++i]; |
63 |
|
break; |
64 |
+ |
case 'l': /* library material */ |
65 |
+ |
cp = getpath(argv[++i], getrlibpath(), R_OK); |
66 |
+ |
if (cp == NULL) { |
67 |
+ |
sprintf(errmsg, |
68 |
+ |
"cannot find library material: '%s'", |
69 |
+ |
argv[i]); |
70 |
+ |
error(SYSTEM, errmsg); |
71 |
+ |
} |
72 |
+ |
matinp[nmatf++] = strcpy(pns, cp); |
73 |
+ |
while (*pns++) |
74 |
+ |
; |
75 |
+ |
break; |
76 |
|
case 'w': /* supress warnings */ |
77 |
|
nowarn = 1; |
78 |
|
break; |
79 |
+ |
case 'v': /* print mesh stats */ |
80 |
+ |
verbose = 1; |
81 |
+ |
break; |
82 |
|
default: |
83 |
|
sprintf(errmsg, "unknown option: '%s'", argv[i]); |
84 |
|
error(USER, errmsg); |
125 |
|
|
126 |
|
writemesh(ourmesh, stdout); /* write mesh to output */ |
127 |
|
|
128 |
< |
/* printmeshstats(ourmesh, stderr); */ |
128 |
> |
if (verbose) |
129 |
> |
printmeshstats(ourmesh, stderr); |
130 |
|
|
131 |
|
quit(0); |
132 |
|
return 0; /* pro forma return */ |
227 |
|
objset(oset, cu->cutree); |
228 |
|
cukid.cusize = cu->cusize * 0.5; |
229 |
|
|
230 |
< |
if (inc==O_IN || oset[0] < objlim || cukid.cusize < |
230 |
> |
if (oset[0] < objlim || cukid.cusize < |
231 |
|
(oset[0] < MAXSET ? mincusize : mincusize/256.0)) { |
232 |
|
/* add to set */ |
233 |
|
if (oset[0] >= MAXSET) { |