ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/ot/obj2mesh.c
(Generate patch)

Comparing ray/src/ot/obj2mesh.c (file contents):
Revision 2.13 by greg, Wed Nov 12 03:54:31 2008 UTC vs.
Revision 2.17 by greg, Mon Feb 6 22:40:21 2023 UTC

# Line 39 | Line 39 | main(          /* compile a .OBJ file into a mesh */
39          char  *argv[]
40   )
41   {
42 <        int  nmatf = 0;
43 <        char  pathnames[12800];
44 <        char  *pns = pathnames;
45 <        char  *matinp[128];
42 >        int  verbose = 0;
43          char  *cp;
44          int  i, j;
45  
# Line 58 | Line 55 | main(          /* compile a .OBJ file into a mesh */
55                          resolu = atoi(argv[++i]);
56                          break;
57                  case 'a':                               /* material file */
58 <                        matinp[nmatf++] = argv[++i];
58 >                        readobj(argv[++i]);
59                          break;
60                  case 'l':                               /* library material */
61                          cp = getpath(argv[++i], getrlibpath(), R_OK);
# Line 66 | Line 63 | main(          /* compile a .OBJ file into a mesh */
63                                  sprintf(errmsg,
64                                          "cannot find library material: '%s'",
65                                                  argv[i]);
66 <                                error(USER, errmsg);
66 >                                error(SYSTEM, errmsg);
67                          }
68 <                        matinp[nmatf++] = strcpy(pns, cp);
72 <                        while (*pns++)
73 <                                ;
68 >                        readobj(cp);
69                          break;
70                  case 'w':                               /* supress warnings */
71                          nowarn = 1;
72                          break;
73 +                case 'v':                               /* print mesh stats */
74 +                        verbose = 1;
75 +                        break;
76                  default:
77                          sprintf(errmsg, "unknown option: '%s'", argv[i]);
78                          error(USER, errmsg);
# Line 85 | Line 83 | main(          /* compile a .OBJ file into a mesh */
83                  error(USER, "too many file arguments");
84                                          /* initialize mesh */
85          cvinit(i==argc-2 ? argv[i+1] : "<stdout>");
88                                        /* load material input */
89        for (j = 0; j < nmatf; j++)
90                readobj(matinp[j]);
86                                          /* read .OBJ file into triangles */
87          if (i == argc)
88                  wfreadobj(NULL);
# Line 121 | Line 116 | main(          /* compile a .OBJ file into a mesh */
116  
117          writemesh(ourmesh, stdout);     /* write mesh to output */
118          
119 <        /* printmeshstats(ourmesh, stderr); */
119 >        if (verbose)
120 >                printmeshstats(ourmesh, stderr);
121  
122          quit(0);
123          return 0; /* pro forma return */
# Line 146 | Line 142 | cputs(void)                                    /* interactive error */
142  
143   void
144   wputs(                          /* warning message */
145 <        char  *s
145 >        const char  *s
146   )
147   {
148          if (!nowarn)
# Line 156 | Line 152 | wputs(                         /* warning message */
152  
153   void
154   eputs(                          /* put string to stderr */
155 <        register char  *s
155 >        const char  *s
156   )
157   {
158          static int  inln = 0;
# Line 173 | Line 169 | eputs(                         /* put string to stderr */
169  
170   static void
171   addface(                        /* add a face to a cube */
172 <        register CUBE  *cu,
172 >        CUBE  *cu,
173          OBJECT  obj
174   )
175   {
# Line 210 | Line 206 | addface(                       /* add a face to a cube */
206  
207   static void
208   add2full(                       /* add object to full node */
209 <        register CUBE  *cu,
209 >        CUBE  *cu,
210          OBJECT  obj
211   )
212   {
213          OCTREE  ot;
214          OBJECT  oset[MAXSET+1];
215          CUBE  cukid;
216 <        register int  i, j;
216 >        int  i, j;
217  
218          objset(oset, cu->cutree);
219          cukid.cusize = cu->cusize * 0.5;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines