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

Comparing ray/src/cv/robjutil.c (file contents):
Revision 2.3 by greg, Sat Feb 27 00:15:55 2021 UTC vs.
Revision 2.4 by greg, Fri Mar 12 18:32:33 2021 UTC

# Line 28 | Line 28 | main(int argc, char *argv[])
28          int             save_mats = 1;
29          int             do_tex = 0;
30          int             do_norm = 0;
31 +        int             do_triangulate = 0;
32          char            *xfm = NULL;
33          char            cbuf[256];
34          double          verteps = -1.;
# Line 86 | Line 87 | main(int argc, char *argv[])
87                  case 'r':                       /* output to Radiance file? */
88                          radout = (argv[i][0] == '+');
89                          break;
90 +                case 'T':                       /* triangulate faces? */
91 +                        do_triangulate = (argv[i][0] == '+');
92 +                        break;
93                  case 'x':                       /* apply a transform */
94                          if (xfm != NULL) {
95                                  fprintf(stderr, "%s: only one '-x' option allowed\n",
# Line 187 | Line 191 | main(int argc, char *argv[])
191                  sprintf(cbuf, "Removed %d duplicate faces", n);
192                  addComment(myScene, cbuf);
193          }
194 +        if (do_triangulate) {
195 +                if (verbose)
196 +                        fputs("Making sure all faces are triangles...\n", stderr);
197 +                n = triangulateScene(myScene);
198 +                if (n > 0) {
199 +                        sprintf(cbuf, "Added %d faces during triangulation", n);
200 +                        addComment(myScene, cbuf);
201 +                }
202 +        }
203          if (xfm != NULL) {
204                  if (verbose)
205                          fputs("Applying transform...\n", stderr);
# Line 218 | Line 231 | userr:
231          fprintf(stderr, "\t+/-t\t\t\t# keep/remove texture coordinates\n");
232          fprintf(stderr, "\t+/-n\t\t\t# keep/remove vertex normals\n");
233          fprintf(stderr, "\t-c epsilon\t\t# coalesce vertices within epsilon\n");
234 +        fprintf(stderr, "\t+T\t\t\t# turn all faces into triangles\n");
235          fprintf(stderr, "\t-x 'xf spec'\t# apply the quoted transform\n");
236          return(1);
237   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines