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

Comparing ray/src/gen/gensurf.c (file contents):
Revision 1.7 by greg, Wed Mar 7 11:14:36 1990 UTC vs.
Revision 1.10 by greg, Fri Jul 20 14:35:59 1990 UTC

# Line 46 | Line 46 | main(argc, argv)
46   int  argc;
47   char  *argv[];
48   {
49 +        extern long     eclock;
50          POINT  *row0, *row1, *row2, *rp;
51          int  i, j, m, n;
52          char  stmp[256];
# Line 60 | Line 61 | char  *argv[];
61  
62          for (i = 8; i < argc; i++)
63                  if (!strcmp(argv[i], "-e"))
64 <                        scompile(NULL, argv[++i]);
64 >                        scompile(argv[++i], NULL, 0);
65                  else if (!strcmp(argv[i], "-f"))
66                          fcompile(argv[++i]);
67                  else if (!strcmp(argv[i], "-s"))
# Line 71 | Line 72 | char  *argv[];
72          modname = argv[1];
73          surfname = argv[2];
74          sprintf(stmp, "%s(s,t)=%s;", XNAME, argv[3]);
75 <        scompile(NULL, stmp);
75 >        scompile(stmp, NULL, 0);
76          sprintf(stmp, "%s(s,t)=%s;", YNAME, argv[4]);
77 <        scompile(NULL, stmp);
77 >        scompile(stmp, NULL, 0);
78          sprintf(stmp, "%s(s,t)=%s;", ZNAME, argv[5]);
79 <        scompile(NULL, stmp);
79 >        scompile(stmp, NULL, 0);
80          m = atoi(argv[6]);
81          n = atoi(argv[7]);
82          if (m <= 0 || n <= 0)
# Line 91 | Line 92 | char  *argv[];
92          row0++; row1++; row2++;
93                                                  /* print header */
94          printhead(argc, argv);
95 +        eclock = 0;
96                                                  /* initialize */
97          comprow(-1.0/m, row0, n);
98          comprow(0.0, row1, n);
# Line 219 | Line 221 | register POINT  *row;
221   int  siz;
222   {
223          double  st[2];
224 +        int  end;
225          register int  i;
226 <                                        /* compute one past each end */
226 >        
227 >        if (smooth) {
228 >                i = -1;                 /* compute one past each end */
229 >                end = siz+1;
230 >        } else {
231 >                if (s < -FTINY || s > 1.0+FTINY)
232 >                        return;
233 >                i = 0;
234 >                end = siz;
235 >        }
236          st[0] = s;
237 <        for (i = -1; i <= siz+1; i++) {
237 >        while (i <= end) {
238                  st[1] = (double)i/siz;
239                  row[i].p[0] = funvalue(XNAME, 2, st);
240                  row[i].p[1] = funvalue(YNAME, 2, st);
241                  row[i].p[2] = funvalue(ZNAME, 2, st);
242 +                i++;
243          }
244   }
245  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines