--- ray/src/gen/gensurf.c 1990/03/07 11:14:36 1.7 +++ ray/src/gen/gensurf.c 1990/07/20 14:35:59 1.10 @@ -46,6 +46,7 @@ main(argc, argv) int argc; char *argv[]; { + extern long eclock; POINT *row0, *row1, *row2, *rp; int i, j, m, n; char stmp[256]; @@ -60,7 +61,7 @@ char *argv[]; for (i = 8; i < argc; i++) if (!strcmp(argv[i], "-e")) - scompile(NULL, argv[++i]); + scompile(argv[++i], NULL, 0); else if (!strcmp(argv[i], "-f")) fcompile(argv[++i]); else if (!strcmp(argv[i], "-s")) @@ -71,11 +72,11 @@ char *argv[]; modname = argv[1]; surfname = argv[2]; sprintf(stmp, "%s(s,t)=%s;", XNAME, argv[3]); - scompile(NULL, stmp); + scompile(stmp, NULL, 0); sprintf(stmp, "%s(s,t)=%s;", YNAME, argv[4]); - scompile(NULL, stmp); + scompile(stmp, NULL, 0); sprintf(stmp, "%s(s,t)=%s;", ZNAME, argv[5]); - scompile(NULL, stmp); + scompile(stmp, NULL, 0); m = atoi(argv[6]); n = atoi(argv[7]); if (m <= 0 || n <= 0) @@ -91,6 +92,7 @@ char *argv[]; row0++; row1++; row2++; /* print header */ printhead(argc, argv); + eclock = 0; /* initialize */ comprow(-1.0/m, row0, n); comprow(0.0, row1, n); @@ -219,14 +221,25 @@ register POINT *row; int siz; { double st[2]; + int end; register int i; - /* compute one past each end */ + + if (smooth) { + i = -1; /* compute one past each end */ + end = siz+1; + } else { + if (s < -FTINY || s > 1.0+FTINY) + return; + i = 0; + end = siz; + } st[0] = s; - for (i = -1; i <= siz+1; i++) { + while (i <= end) { st[1] = (double)i/siz; row[i].p[0] = funvalue(XNAME, 2, st); row[i].p[1] = funvalue(YNAME, 2, st); row[i].p[2] = funvalue(ZNAME, 2, st); + i++; } }