--- ray/src/gen/genblinds.c 2005/12/28 19:42:13 2.12 +++ ray/src/gen/genblinds.c 2020/07/25 19:23:09 2.15 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: genblinds.c,v 2.12 2005/12/28 19:42:13 greg Exp $"; +static const char RCSid[] = "$Id: genblinds.c,v 2.15 2020/07/25 19:23:09 greg Exp $"; #endif /* * genblind2.c - make some curved or flat venetian blinds. @@ -15,13 +15,14 @@ static const char RCSid[] = "$Id: genblinds.c,v 2.12 2 * rcurv - curvature radius of slats (up:>0;down:<0;flat:=0) */ -#include -#include +#include "rtio.h" +#include #include -#include +#ifndef PI #define PI 3.14159265358979323846 -#define DELTA 10. /* MINIMAL SUSTAINED ANGLE IN DEGREES */ +#endif +#define DELTA 3. /* MINIMAL SUSTAINED ANGLE IN DEGREES */ double baseflat[4][3], baseblind[4][3][180]; double A[3],X[3]; @@ -32,9 +33,7 @@ int nslats, nsurf; static void makeflat(double w, double d, double a); static void printslat(int n); -static void printhead(register int ac, register char **av); - void makeflat( double w, @@ -67,7 +66,7 @@ printslat( /* print slat # n */ int n ) { - register int i, k; + int i, k; for (k=0; k < nsurf; k++) { printf("\n%s polygon %s.%d.%d\n", material, name, n, k); @@ -81,21 +80,6 @@ printslat( /* print slat # n */ } -void -printhead( /* print command header */ - register int ac, - register char **av -) -{ - putchar('#'); - while (ac--) { - putchar(' '); - fputs(*av++, stdout); - } - putchar('\n'); -} - - int main( int argc, @@ -116,14 +100,14 @@ main( height = atof(argv[5]); nslats = atoi(argv[6]); angle = atof(argv[7]); - if (argc == 10) + if (argc == 10) { if (!strcmp(argv[8], "-r")) rcurv = atof(argv[9]); else if (!strcmp(argv[8], "+r")) rcurv = -atof(argv[9]); else goto userr; - + } /* CURVED BLIND CALCULATION */ if (rcurv != 0.) { @@ -201,8 +185,9 @@ main( } } - printhead(argc, argv); - + fputs("# ", stdout); + printargs(argc, argv, stdout); + /* REPEAT THE BASIC CURVED OR FLAT SLAT TO GET THE OVERALL BLIND */