--- ray/src/gen/genrev.c 2018/01/12 00:50:17 2.11 +++ ray/src/gen/genrev.c 2024/12/10 17:22:39 2.15 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: genrev.c,v 2.11 2018/01/12 00:50:17 greg Exp $"; +static const char RCSid[] = "$Id: genrev.c,v 2.15 2024/12/10 17:22:39 greg Exp $"; #endif /* * genrev.c - program to generate functions of rotation about z @@ -12,10 +12,9 @@ static const char RCSid[] = "$Id: genrev.c,v 2.11 2018 */ #include -#include -#include #include +#include "rtio.h" #include "rterror.h" #include "resolu.h" #include "calcomp.h" @@ -112,9 +111,15 @@ char *argv[]; for (i = 6; i < argc; i++) if (!strcmp(argv[i], "-e")) scompile(argv[++i], NULL, 0); - else if (!strcmp(argv[i], "-f")) - fcompile(argv[++i]); - else if (!strcmp(argv[i], "-s")) + else if (!strcmp(argv[i], "-f")) { + char *fpath = getpath(argv[++i], getrlibpath(), 0); + if (fpath == NULL) { + fprintf(stderr, "%s: cannot find file '%s'\n", + argv[0], argv[i]); + quit(1); + } + fcompile(fpath); + } else if (!strcmp(argv[i], "-s")) smooth = 1; else goto userror; @@ -123,14 +128,14 @@ char *argv[]; scompile(stmp, NULL, 0); sprintf(stmp, "%s(t)=%s;", RNAME, argv[4]); scompile(stmp, NULL, 0); - nseg = atoi(argv[5]); + nseg = eval(argv[5]) + .5; if (nseg <= 0) goto userror; modname = smooth ? "Phong" : argv[1]; fputs("# ", stdout); printargs(argc, argv, stdout); - eclock = 0; + eclock = 1; lastnz = lastnr = 0.0; t = 0.0;