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

Comparing ray/src/util/rfluxmtx.c (file contents):
Revision 2.5 by greg, Tue Jul 22 23:21:56 2014 UTC vs.
Revision 2.19 by greg, Thu Dec 4 05:26:28 2014 UTC

# Line 11 | Line 11 | static const char RCSid[] = "$Id$";
11   #include <stdlib.h>
12   #include "rtio.h"
13   #include "rtmath.h"
14 + #include "rtprocess.h"
15   #include "bsdf.h"
16   #include "bsdf_m.h"
17   #include "random.h"
# Line 35 | Line 36 | static const char RCSid[] = "$Id$";
36  
37   char            *progname;              /* global argv[0] */
38  
39 < int             verbose = 0;            /* verbose mode? */
39 > int             verbose = 0;            /* verbose mode (< 0 no warnings) */
40  
41   char            *rcarg[MAXRCARG+1] = {"rcontrib", "-fo+"};
42   int             nrcargs = 2;
# Line 96 | Line 97 | typedef struct param_s {
97  
98   PARAMS          curparams;
99   char            curmod[128];
100 + char            newparams[1024];
101  
102   typedef int     SURFSAMP(FVECT, SURF *, double);
103  
# Line 109 | Line 111 | SURFSAMP       *orig_in_surf[4] = {
111   static void
112   clear_params(PARAMS *p, int reset_only)
113   {
112        curmod[0] = '\0';
114          while (p->slist != NULL) {
115                  SURF    *sdel = p->slist;
116                  p->slist = sdel->next;
# Line 124 | Line 125 | clear_params(PARAMS *p, int reset_only)
125                  p->outfn = NULL;
126                  return;
127          }
128 <        memset(p, 0, sizeof(curparams));
128 >        memset(p, 0, sizeof(PARAMS));
129   }
130  
131   /* Get surface type from name */
# Line 144 | Line 145 | surf_type(const char *otype)
145   static char *
146   oconv_command(int ac, char *av[])
147   {
148 <        static char     oconvbuf[2048] = "!oconv -f";
149 <        char            *cp = oconvbuf + 9;
150 <
148 >        static char     oconvbuf[2048] = "!oconv -f ";
149 >        char            *cp = oconvbuf + 10;
150 >        char            *recv = *av++;
151 >        
152 >        if (ac-- <= 0)
153 >                return(NULL);
154          while (ac-- > 0) {
155 +                strcpy(cp, *av++);
156 +                while (*cp) cp++;
157 +                *cp++ = ' ';
158                  if (cp >= oconvbuf+(sizeof(oconvbuf)-32)) {
159                          fputs(progname, stderr);
160                          fputs(": too many file arguments!\n", stderr);
161                          exit(1);
162                  }
156                *cp++ = ' ';
157                strcpy(cp, *av++);
158                while (*cp) cp++;
163          }
164 <        *cp = '\0';
164 >        strcpy(cp, recv);       /* receiver goes last */
165          return(oconvbuf);
166   }
167  
# Line 222 | Line 226 | popen_arglist(char *av[], char *mode)
226                  fputs(": command line too long in popen_arglist()\n", stderr);
227                  return(NULL);
228          }
229 <        if (verbose)
229 >        if (verbose > 0)
230                  fprintf(stderr, "%s: opening pipe %s: %s\n",
231                                  progname, (*mode=='w') ? "to" : "from", cmd);
232          return(popen(cmd, mode));
# Line 240 | Line 244 | my_exec(char *av[])
244                  fputs(": command line too long in my_exec()\n", stderr);
245                  return(1);
246          }
247 <        if (verbose)
247 >        if (verbose > 0)
248                  fprintf(stderr, "%s: running: %s\n", progname, cmd);
249          return(system(cmd));
250   }
# Line 255 | Line 259 | my_exec(char *av[])
259                  fprintf(stderr, "%s: cannot locate %s\n", progname, av[0]);
260                  return(1);
261          }
262 <        if (verbose) {
262 >        if (verbose > 0) {
263                  char    cmd[4096];
264                  if (!convert_commandline(cmd, sizeof(cmd), av))
265                          strcpy(cmd, "COMMAND TOO LONG TO SHOW");
# Line 309 | Line 313 | nextchar:
313  
314   /* Parse program parameters (directives) */
315   static int
316 < parse_params(char *pargs)
316 > parse_params(PARAMS *p, char *pargs)
317   {
318          char    *cp = pargs;
319          int     nparams = 0;
320          int     i;
321  
322 <        for ( ; ; )
322 >        for ( ; ; ) {
323                  switch (*cp++) {
324                  case 'h':
325                          if (*cp++ != '=')
326                                  break;
327 <                        curparams.hsiz = 0;
327 >                        p->hsiz = 0;
328                          i = 0;
329                          while (*cp && !isspace(*cp)) {
330                                  if (isdigit(*cp))
331 <                                        curparams.hsiz = 10*curparams.hsiz +
332 <                                                                *cp - '0';
329 <                                curparams.hemis[i++] = *cp++;
331 >                                        p->hsiz = 10*p->hsiz + *cp - '0';
332 >                                p->hemis[i++] = *cp++;
333                          }
334                          if (!i)
335                                  break;
336 <                        curparams.hemis[i] = '\0';
337 <                        curparams.hsiz += !curparams.hsiz;
336 >                        p->hemis[i] = '\0';
337 >                        p->hsiz += !p->hsiz;
338                          ++nparams;
339                          continue;
340                  case 'u':
341                          if (*cp++ != '=')
342                                  break;
343 <                        if (!get_direction(curparams.vup, cp))
343 >                        if (!get_direction(p->vup, cp))
344                                  break;
345 +                        while (*cp && !isspace(*cp++))
346 +                                ;
347                          ++nparams;
348                          continue;
349                  case 'o':
# Line 350 | Line 355 | parse_params(char *pargs)
355                          if (!i)
356                                  break;
357                          *--cp = '\0';
358 <                        curparams.outfn = savqstr(cp-i);
358 >                        p->outfn = savqstr(cp-i);
359                          *cp++ = ' ';
360                          ++nparams;
361                          continue;
362                  case ' ':
363                  case '\t':
364                  case '\r':
360                case '\n':
365                          continue;
366 +                case '\n':
367                  case '\0':
368                          return(nparams);
369                  default:
370                          break;
371                  }
372 <        fprintf(stderr, "%s: bad parameter string '%s'\n", progname, pargs);
372 >                break;
373 >        }
374 >        fprintf(stderr, "%s: bad parameter string: %s", progname, pargs);
375          exit(1);
376          return(-1);     /* pro forma return */
377   }
# Line 402 | Line 409 | finish_receiver(void)
409                  fputs(": undefined normal for hemisphere sampling\n", stderr);
410                  exit(1);
411          }
412 <        if (normalize(curparams.vup) == 0)
412 >        if (normalize(curparams.vup) == 0) {
413                  if (fabs(curparams.nrm[2]) < .7)
414                          curparams.vup[2] = 1;
415                  else
416                          curparams.vup[1] = 1;
417 +        }
418                                          /* determine sample type/bin */
419          if (tolower(curparams.hemis[0]) == 'u' | curparams.hemis[0] == '1') {
420                  binv = "0";             /* uniform sampling -- one bin */
# Line 420 | Line 428 | finish_receiver(void)
428                          exit(1);
429                  }
430                  calfn = shirchiufn; shirchiufn = NULL;
431 <                sprintf(sbuf, "SCdim=%d,Nx=%g,Ny=%g,Nz=%g,Ux=%g,Uy=%g,Uz=%g",
431 >                sprintf(sbuf, "SCdim=%d,rNx=%g,rNy=%g,rNz=%g,Ux=%g,Uy=%g,Uz=%g",
432                                  curparams.hsiz,
433                          curparams.nrm[0], curparams.nrm[1], curparams.nrm[2],
434                          curparams.vup[0], curparams.vup[1], curparams.vup[2]);
# Line 430 | Line 438 | finish_receiver(void)
438          } else if ((tolower(curparams.hemis[0]) == 'r') |
439                          (tolower(curparams.hemis[0]) == 't')) {
440                  calfn = reinhfn; reinhfn = NULL;
441 <                sprintf(sbuf, "MF=%d,Nx=%g,Ny=%g,Nz=%g,Ux=%g,Uy=%g,Uz=%g",
441 >                sprintf(sbuf, "MF=%d,rNx=%g,rNy=%g,rNz=%g,Ux=%g,Uy=%g,Uz=%g",
442                                  curparams.hsiz,
443                          curparams.nrm[0], curparams.nrm[1], curparams.nrm[2],
444                          curparams.vup[0], curparams.vup[1], curparams.vup[2]);
# Line 508 | Line 516 | make_axes(FVECT uva[2], const FVECT nrm)
516   {
517          int     i;
518  
519 <        uva[1][0] = 0.5 - frandom();
512 <        uva[1][1] = 0.5 - frandom();
513 <        uva[1][2] = 0.5 - frandom();
514 <        for (i = 3; i--; )
515 <                if ((-0.6 < nrm[i]) & (nrm[i] < 0.6))
516 <                        break;
517 <        if (i < 0) {
519 >        if (!getperpendicular(uva[0], nrm)) {
520                  fputs(progname, stderr);
521                  fputs(": bad surface normal in make_axes!\n", stderr);
522                  exit(1);
523          }
524 <        uva[1][i] = 1.0;
523 <        VCROSS(uva[0], uva[1], nrm);
524 <        normalize(uva[0]);
525 <        VCROSS(uva[1], nrm, uva[0]);
524 >        fcross(uva[1], nrm, uva[0]);
525   }
526  
527   /* Illegal sender surfaces end up here */
# Line 554 | Line 553 | ssamp_ring(FVECT orig, SURF *sp, double x)
553                  sp->priv = (void *)uva;
554          }
555          SDmultiSamp(samp2, 2, x);
556 <        samp2[0] = sp->farg[6] + sqrt(samp2[0]*sp->area*(1./PI));
556 >        samp2[0] = sqrt(samp2[0]*sp->area*(1./PI) + sp->farg[6]*sp->farg[6]);
557          samp2[1] *= 2.*PI;
558          uv[0] = samp2[0]*tcos(samp2[1]);
559          uv[1] = samp2[0]*tsin(samp2[1]);
# Line 607 | Line 606 | ssamp_poly(FVECT orig, SURF *sp, double x)
606                          }
607                          ptp->ntris = 0;
608                          v2l->p = (void *)ptp;
609 <                        if (!polyTriangulate(v2l, add_triangle))
609 >                        if (!polyTriangulate(v2l, add_triangle)) {
610 >                                fprintf(stderr,
611 >                                        "%s: cannot triangulate polygon '%s'\n",
612 >                                                progname, sp->sname);
613                                  return(0);
614 +                        }
615                          for (i = ptp->ntris; i--; ) {
616                                  int     a = ptp->tri[i].vndx[0];
617                                  int     b = ptp->tri[i].vndx[1];
# Line 657 | Line 660 | sample_origin(PARAMS *p, FVECT orig, const FVECT rdir,
660                                          /* special case for lone surface */
661          if (p->nsurfs == 1) {
662                  sp = p->slist;
663 <                if (DOT(sp->snrm, rdir) >= -FTINY)
664 <                        return(0);      /* behind surface! */
663 >                if (DOT(sp->snrm, rdir) >= -FTINY) {
664 >                        fprintf(stderr,
665 >                                "%s: internal - sample behind sender '%s'\n",
666 >                                        progname, sp->sname);
667 >                        return(0);
668 >                }
669                  return((*orig_in_surf[sp->styp])(orig, sp, x));
670          }
671          if (p->nsurfs > nall) {         /* (re)allocate surface area cache */
# Line 672 | Line 679 | sample_origin(PARAMS *p, FVECT orig, const FVECT rdir,
679                  projsa[i] = -DOT(sp->snrm, rdir) * sp->area;
680                  tarea += projsa[i] *= (double)(projsa[i] > FTINY);
681          }
682 <        if (tarea <= FTINY)             /* wrong side of sender? */
682 >        if (tarea <= FTINY) {           /* wrong side of sender? */
683 >                fputs(progname, stderr);
684 >                fputs(": internal - sample behind all sender elements!\n",
685 >                                stderr);
686                  return(0);
687 +        }
688          tarea *= x;                     /* get surface from list */
689          for (i = 0, sp = p->slist; tarea > projsa[i]; sp = sp->next)
690                  tarea -= projsa[i++];
# Line 746 | Line 757 | sample_reinhart(PARAMS *p, int b, FILE *fp)
757   #define T_NALT  7
758          static const int        tnaz[T_NALT] = {30, 30, 24, 24, 18, 12, 6};
759          const int               RowMax = T_NALT*p->hsiz + 1;
760 <        const double            RAH = (.25*PI)/(RowMax-.5);
760 >        const double            RAH = (.5*PI)/(RowMax-.5);
761   #define rnaz(r)                 (r >= RowMax-1 ? 1 : p->hsiz*tnaz[r/p->hsiz])
762          int                     n = sampcnt;
763          int                     row, col;
# Line 771 | Line 782 | sample_reinhart(PARAMS *p, int b, FILE *fp)
782                  SDmultiSamp(samp3, 3, (n+frandom())/sampcnt);
783                  alt = (row+samp3[1])*RAH;
784                  azi = (2.*PI)*(col+samp3[2]-.5)/rnaz(row);
785 <                duvw[2] = tcos(alt);    /* measured from horizon */
786 <                duvw[0] = tcos(azi)*duvw[2];
787 <                duvw[1] = tsin(azi)*duvw[2];
785 >                duvw[2] = cos(alt);     /* measured from horizon */
786 >                duvw[0] = tsin(azi)*duvw[2];
787 >                duvw[1] = tcos(azi)*duvw[2];
788                  duvw[2] = sqrt(1. - duvw[2]*duvw[2]);
789                  for (i = 3; i--; )
790                          orig_dir[1][i] = -duvw[0]*p->udir[i] -
# Line 824 | Line 835 | sample_klems(PARAMS *p, int b, FILE *fp)
835  
836          while (n--) {                   /* stratified sampling */
837                  SDmultiSamp(samp2, 2, (n+frandom())/sampcnt);
838 <                if (!bo_getvec(duvw, b+samp2[1], kbasis[bi]))
838 >                if (!bi_getvec(duvw, b+samp2[1], kbasis[bi]))
839                          return(0);
840                  for (i = 3; i--; )
841                          orig_dir[1][i] = duvw[0]*p->udir[i] +
# Line 847 | Line 858 | prepare_sampler(void)
858                  fputs(": no sender surface!\n", stderr);
859                  return(-1);
860          }
861 <        if (curparams.outfn != NULL)    /* misplaced output file spec. */
861 >                                        /* misplaced output file spec. */
862 >        if ((curparams.outfn != NULL) & (verbose >= 0))
863                  fprintf(stderr, "%s: warning - ignoring output file in sender ('%s')\n",
864                                  progname, curparams.outfn);
865                                          /* check/set basis hemisphere */
# Line 861 | Line 873 | prepare_sampler(void)
873                  fputs(": undefined normal for sender sampling\n", stderr);
874                  return(-1);
875          }
876 <        if (normalize(curparams.vup) == 0)
876 >        if (normalize(curparams.vup) == 0) {
877                  if (fabs(curparams.nrm[2]) < .7)
878                          curparams.vup[2] = 1;
879                  else
880                          curparams.vup[1] = 1;
881 +        }
882          VCROSS(curparams.udir, curparams.vup, curparams.nrm);
883          if (normalize(curparams.udir) == 0) {
884                  fputs(progname, stderr);
# Line 989 | Line 1002 | add_surface(int st, const char *oname, FILE *fp)
1002          case ST_SOURCE:
1003                  if (snew->nfargs != 4)
1004                          goto badcount;
1005 <                VCOPY(snew->snrm, snew->farg);
1005 >                for (n = 3; n--; )      /* need to reverse "normal" */
1006 >                        snew->snrm[n] = -snew->farg[n];
1007                  if (normalize(snew->snrm) == 0)
1008                          goto badnorm;
1009                  snew->area = sin((PI/180./2.)*snew->farg[3]);
1010                  snew->area *= PI*snew->area;
1011                  break;
1012          }
1013 <        if (snew->area <= FTINY) {
1013 >        if ((snew->area <= FTINY) & (verbose >= 0)) {
1014                  fprintf(stderr, "%s: warning - zero area for surface '%s'\n",
1015                                  progname, oname);
1016                  free(snew);
# Line 1008 | Line 1022 | add_surface(int st, const char *oname, FILE *fp)
1022          curparams.nsurfs++;
1023          return;
1024   badcount:
1025 <        fprintf(stderr, "%s: bad argument count for surface '%s'\n",
1025 >        fprintf(stderr, "%s: bad argument count for surface element '%s'\n",
1026                          progname, oname);
1027          exit(1);
1028   badnorm:
1029 <        fprintf(stderr, "%s: bad orientation for surface '%s'\n",
1029 >        fprintf(stderr, "%s: bad orientation for surface element '%s'\n",
1030                          progname, oname);
1031          exit(1);
1032   }
# Line 1044 | Line 1058 | add_recv_object(FILE *fp)
1058                                  finish_receiver();
1059                                  clear_params(&curparams, 1);
1060                          }
1061 +                        parse_params(&curparams, newparams);
1062 +                        newparams[0] = '\0';
1063                          strcpy(curmod, thismod);
1064                  }
1065                  add_surface(st, oname, fp);     /* read & store surface */
1066                  return(1);
1067          }
1068                                          /* else skip arguments */
1069 <        if (!fscanf(fp, "%d", &n)) return;
1069 >        if (!fscanf(fp, "%d", &n)) return(0);
1070          while (n-- > 0) fscanf(fp, "%*s");
1071 <        if (!fscanf(fp, "%d", &n)) return;
1071 >        if (!fscanf(fp, "%d", &n)) return(0);
1072          while (n-- > 0) fscanf(fp, "%*d");
1073 <        if (!fscanf(fp, "%d", &n)) return;
1073 >        if (!fscanf(fp, "%d", &n)) return(0);
1074          while (n-- > 0) fscanf(fp, "%*f");
1075          return(0);
1076   }
# Line 1080 | Line 1096 | add_send_object(FILE *fp)
1096                          fputs(": cannot use source as a sender!\n", stderr);
1097                          return(-1);
1098                  }
1099 +                parse_params(&curparams, newparams);
1100 +                newparams[0] = '\0';
1101                  add_surface(st, oname, fp);     /* read & store surface */
1102                  return(0);
1103          }
1104                                          /* else skip arguments */
1105 <        if (!fscanf(fp, "%d", &n)) return;
1105 >        if (!fscanf(fp, "%d", &n)) return(0);
1106          while (n-- > 0) fscanf(fp, "%*s");
1107 <        if (!fscanf(fp, "%d", &n)) return;
1107 >        if (!fscanf(fp, "%d", &n)) return(0);
1108          while (n-- > 0) fscanf(fp, "%*d");
1109 <        if (!fscanf(fp, "%d", &n)) return;
1109 >        if (!fscanf(fp, "%d", &n)) return(0);
1110          while (n-- > 0) fscanf(fp, "%*f");
1111          return(0);
1112   }
# Line 1128 | Line 1146 | load_scene(const char *inspec, int (*ocb)(FILE *))
1146                          if (!isspace(c) && fscanf(fp, "%s", inpbuf) == 1 &&
1147                                          !strcmp(inpbuf, PARAMSTART)) {
1148                                  if (fgets(inpbuf, sizeof(inpbuf), fp) != NULL)
1149 <                                        parse_params(inpbuf);
1149 >                                        strcat(newparams, inpbuf);
1150                                  continue;
1151                          }
1152 <                        while ((c = getc(fp)) != EOF && c != '\n');
1152 >                        while ((c = getc(fp)) != EOF && c != '\n')
1153                                  ;       /* else skipping comment */
1154                          continue;
1155                  }
# Line 1156 | Line 1174 | main(int argc, char *argv[])
1174   {
1175          char    fmtopt[6] = "-faa";     /* default output is ASCII */
1176          char    *xrs=NULL, *yrs=NULL, *ldopt=NULL;
1177 +        char    *iropt = NULL;
1178          char    *sendfn;
1179          char    sampcntbuf[32], nsbinbuf[32];
1180          FILE    *rcfp;
# Line 1163 | Line 1182 | main(int argc, char *argv[])
1182          int     a, i;
1183                                          /* screen rcontrib options */
1184          progname = argv[0];
1185 <        for (a = 1; a < argc-2 && argv[a][0] == '-'; a++) {
1186 <                int     na = 1;         /* !! Keep consistent !! */
1187 <                switch (argv[a][1]) {
1185 >        for (a = 1; a < argc-2; a++) {
1186 >                int     na;
1187 >                                        /* check for argument expansion */
1188 >                while ((na = expandarg(&argc, &argv, a)) > 0)
1189 >                        ;
1190 >                if (na < 0) {
1191 >                        fprintf(stderr, "%s: cannot expand '%s'\n",
1192 >                                        progname, argv[a]);
1193 >                        return(1);
1194 >                }
1195 >                if (argv[a][0] != '-' || !argv[a][1])
1196 >                        break;
1197 >                na = 1;
1198 >                switch (argv[a][1]) {   /* !! Keep consistent !! */
1199                  case 'v':               /* verbose mode */
1200 <                        verbose = !verbose;
1200 >                        verbose = 1;
1201                          na = 0;
1202                          continue;
1203                  case 'f':               /* special case for -fo, -ff, etc. */
# Line 1180 | Line 1210 | main(int argc, char *argv[])
1210                          case 'f':
1211                          case 'd':
1212                          case 'c':
1213 <                                if (!(fmtopt[4] = argv[a][3]))
1214 <                                        fmtopt[4] = argv[a][2];
1215 <                                fmtopt[3] = argv[a][2];
1213 >                                if (!(fmtopt[3] = argv[a][3]))
1214 >                                        fmtopt[3] = argv[a][2];
1215 >                                fmtopt[2] = argv[a][2];
1216                                  na = 0;
1217                                  continue;       /* will pass later */
1218                          default:
# Line 1198 | Line 1228 | main(int argc, char *argv[])
1228                          na = 0;
1229                          continue;
1230                  case 'c':               /* number of samples */
1231 <                        sampcnt = atoi(argv[a+1]);
1231 >                        sampcnt = atoi(argv[++a]);
1232                          if (sampcnt <= 0)
1233                                  goto userr;
1234                          na = 0;         /* we re-add this later */
1235                          continue;
1236 <                case 'V':               /* options without arguments */
1207 <                case 'w':
1208 <                case 'u':
1236 >                case 'I':               /* only for pass-through mode */
1237                  case 'i':
1238 +                        iropt = argv[a];
1239 +                        na = 0;
1240 +                        continue;
1241 +                case 'w':               /* options without arguments */
1242 +                        if (argv[a][2] != '+') verbose = -1;
1243 +                case 'V':
1244 +                case 'u':
1245                  case 'h':
1246                  case 'r':
1247                          break;
# Line 1236 | Line 1271 | main(int argc, char *argv[])
1271                          if (!argv[a][2]) goto userr;
1272                          na = (argv[a][2] == 'e') | (argv[a][2] == 'a') ? 4 : 2;
1273                          break;
1239                case '\0':              /* pass-through mode */
1240                        goto done_opts;
1274                  default:                /* anything else is verbotten */
1275                          goto userr;
1276                  }
# Line 1247 | Line 1280 | main(int argc, char *argv[])
1280                  while (--na)            /* + arguments if any */
1281                          rcarg[nrcargs++] = argv[++a];
1282          }
1250 done_opts:
1283          if (a > argc-2)
1284                  goto userr;             /* check at end of options */
1285          sendfn = argv[a++];             /* assign sender & receiver inputs */
1286          if (sendfn[0] == '-') {         /* user wants pass-through mode? */
1287                  if (sendfn[1]) goto userr;
1288                  sendfn = NULL;
1289 +                if (iropt) {
1290 +                        CHECKARGC(1);
1291 +                        rcarg[nrcargs++] = iropt;
1292 +                }
1293                  if (xrs) {
1294                          CHECKARGC(2);
1295                          rcarg[nrcargs++] = "-x";
# Line 1269 | Line 1305 | done_opts:
1305                          rcarg[nrcargs++] = ldopt;
1306                  }
1307                  if (sampcnt <= 0) sampcnt = 1;
1308 <        } else {                        /* else FVECT determines input format */
1309 <                fmtopt[3] = (sizeof(RREAL)==sizeof(double)) ? 'd' : 'f';
1308 >        } else {                        /* else in sampling mode */
1309 >                if (iropt) {
1310 >                        fputs(progname, stderr);
1311 >                        fputs(": -i, -I supported for pass-through only\n", stderr);
1312 >                        return(1);
1313 >                }
1314 >                fmtopt[2] = (sizeof(RREAL)==sizeof(double)) ? 'd' : 'f';
1315                  if (sampcnt <= 0) sampcnt = 10000;
1316          }
1317          sprintf(sampcntbuf, "%d", sampcnt);
# Line 1309 | Line 1350 | done_opts:
1350          if (verbose) {
1351                  fprintf(stderr, "%s: sampling %d directions", progname, nsbins);
1352                  if (curparams.nsurfs > 1)
1353 <                        fprintf(stderr, " (%d surfaces)\n", curparams.nsurfs);
1353 >                        fprintf(stderr, " (%d elements)\n", curparams.nsurfs);
1354                  else
1355                          fputc('\n', stderr);
1356          }
# Line 1320 | Line 1361 | done_opts:
1361   userr:
1362          if (a < argc-2)
1363                  fprintf(stderr, "%s: unsupported option '%s'", progname, argv[a]);
1364 <        fprintf(stderr, "Usage: %s [-v][rcontrib options] sender.rad receiver.rad [system.rad ..]\n",
1364 >        fprintf(stderr, "Usage: %s [-v][rcontrib options] sender.rad receiver.rad [-i system.oct] [system.rad ..]\n",
1365                                  progname);
1366          return(1);
1367   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines