--- ray/src/ot/obj2mesh.c 2004/04/23 00:56:27 2.11 +++ ray/src/ot/obj2mesh.c 2017/03/03 01:25:27 2.15 @@ -1,11 +1,12 @@ #ifndef lint -static const char RCSid[] = "$Id: obj2mesh.c,v 2.11 2004/04/23 00:56:27 greg Exp $"; +static const char RCSid[] = "$Id: obj2mesh.c,v 2.15 2017/03/03 01:25:27 greg Exp $"; #endif /* * Main program to compile a Wavefront .OBJ file into a Radiance mesh */ #include "copyright.h" +#include "paths.h" #include "platform.h" #include "standard.h" #include "resolu.h" @@ -22,7 +23,7 @@ char *progname; /* argv[0] */ int nowarn = 0; /* supress warnings? */ -int objlim = 15; /* # of objects before split */ +int objlim = 9; /* # of objects before split */ int resolu = 16384; /* octree resolution limit */ @@ -39,6 +40,7 @@ main( /* compile a .OBJ file into a mesh */ ) { int nmatf = 0; + int verbose = 0; char pathnames[12800]; char *pns = pathnames; char *matinp[128]; @@ -65,7 +67,7 @@ main( /* compile a .OBJ file into a mesh */ sprintf(errmsg, "cannot find library material: '%s'", argv[i]); - error(USER, errmsg); + error(SYSTEM, errmsg); } matinp[nmatf++] = strcpy(pns, cp); while (*pns++) @@ -74,6 +76,9 @@ main( /* compile a .OBJ file into a mesh */ case 'w': /* supress warnings */ nowarn = 1; break; + case 'v': /* print mesh stats */ + verbose = 1; + break; default: sprintf(errmsg, "unknown option: '%s'", argv[i]); error(USER, errmsg); @@ -120,7 +125,8 @@ main( /* compile a .OBJ file into a mesh */ writemesh(ourmesh, stdout); /* write mesh to output */ - /* printmeshstats(ourmesh, stderr); */ + if (verbose) + printmeshstats(ourmesh, stderr); quit(0); return 0; /* pro forma return */