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

Comparing ray/src/util/wrapBSDF.c (file contents):
Revision 2.20 by schorsch, Sun Mar 6 01:13:18 2016 UTC vs.
Revision 2.22 by greg, Tue Feb 14 19:58:37 2017 UTC

# Line 52 | Line 52 | struct s_fieldID {
52   } XMLfieldID[] = {
53          {"m", 0, 1, "Manufacturer"},
54          {"n", 0, 1, "Name"},
55 +        {"d", 0, 0, "DeviceType"},
56          {"c", 0, 0, "ThermalConductivity"},
57          {"ef", 0, 0, "EmissivityFront"},
58          {"eb", 0, 0, "EmissivityBack"},
# Line 63 | Line 64 | struct s_fieldID {
64          {"\0", 0, 0, NULL}      /* terminator */
65   };
66                                          /* field assignments */
67 < #define MAXASSIGN       12
67 > #define MAXASSIGN       16
68   const char      *field_assignment[MAXASSIGN];
69   int             nfield_assign = 0;
70   #define FASEP   ';'
# Line 395 | Line 396 | determine_angle_basis(const char *fn, ezxml_t wtl)
396   static int
397   filter_klems_matrix(FILE *fp)
398   {
398 #define MAX_COLUMNS     145
399          const char      *bn = klems_basis_name[angle_basis];
400        float           col_corr[MAX_COLUMNS];
400          int             i, j, n = nabases;
401                                          /* get angle basis */
402          while (n-- > 0)
# Line 405 | Line 404 | filter_klems_matrix(FILE *fp)
404                          break;
405          if (n < 0)
406                  return 0;
408        if (abase_list[n].nangles > MAX_COLUMNS) {
409                fputs("Internal error - too many Klems columns!\n", stderr);
410                return 0;
411        }
412                                        /* get correction factors */
413        for (j = abase_list[n].nangles; j--; )
414                col_corr[j] = 1.f / io_getohm(j, &abase_list[n]);
407                                          /* read/correct/write matrix */
408          for (i = 0; i < abase_list[n].nangles; i++) {
409 +            const double        corr = 1./io_getohm(i, &abase_list[n]);
410              for (j = 0; j < abase_list[n].nangles; j++) {
411                  double  d;
412                  if (fscanf(fp, "%lf", &d) != 1)
# Line 422 | Line 415 | filter_klems_matrix(FILE *fp)
415                          fputs("Negative BSDF data!\n", stderr);
416                          return 0;
417                  }
418 <                printf(" %.3e", d*col_corr[j]*(d > 0));
418 >                printf(" %.3e", d*corr*(d > 0));
419              }
420              fputc('\n', stdout);
421          }
# Line 432 | Line 425 | filter_klems_matrix(FILE *fp)
425                          return 0;
426                  }
427          return 1;                       /* all is good */
435 #undef MAX_COLUMNS
428   }
429  
430   /* Write out BSDF data block with surrounding tags */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines