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

Comparing ray/src/gen/genbox.c (file contents):
Revision 2.11 by greg, Fri Apr 9 01:48:20 2021 UTC vs.
Revision 2.13 by greg, Thu Apr 15 23:51:04 2021 UTC

# Line 274 | Line 274 | sphere(int v0)                                 /* generate a rounded corner */
274   int
275   main(int argc, char *argv[])
276   {
277 +        int  smooth = 0;
278          int  nsegs = 1;
279          int  objout = 0;
280          int  i;
# Line 301 | Line 302 | main(int argc, char *argv[])
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 */
# Line 397 | Line 401 | main(int argc, char *argv[])
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)
# Line 409 | Line 416 | main(int argc, char *argv[])
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   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines