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

Comparing ray/src/cv/bsdf2rad.c (file contents):
Revision 2.34 by greg, Fri Jul 20 00:50:40 2018 UTC vs.
Revision 2.37 by greg, Fri Feb 12 00:53:56 2021 UTC

# Line 5 | Line 5 | static const char RCSid[] = "$Id$";
5   *  Plot 3-D BSDF output based on scattering interpolant or XML representation
6   */
7  
8 #include <stdio.h>
9 #include <string.h>
8   #include <stdlib.h>
9 + #include "rtio.h"
10   #include "paths.h"
11   #include "rtmath.h"
13 #include "resolu.h"
12   #include "bsdfrep.h"
13  
14   #ifndef NINCIDENT
# Line 43 | Line 41 | const double   sph_xoffset = 15.;
41   #define bsdf_rad        (sph_rad*.25)
42   #define arrow_rad       (bsdf_rad*.015)
43  
46 #define FEQ(a,b)        ((a)-(b) <= 1e-7 && (b)-(a) <= 1e-7)
47
44   #define set_minlog()    overall_min = (overall_min < 1e-5) ? 1e-5 : overall_min; \
45                                  min_log10 = log10(overall_min) - .1
46  
# Line 350 | Line 346 | addrot(char *xf, const FVECT xp, const FVECT yp, const
346                  return(4);
347          }
348          theta = atan2(yp[2], zp[2]);
349 <        if (!FEQ(theta,0.0)) {
349 >        if (!FABSEQ(theta,0.0)) {
350                  sprintf(xf, " -rx %f", theta*(180./PI));
351                  while (*xf) ++xf;
352                  n += 2;
353          }
354          theta = Asin(-xp[2]);
355 <        if (!FEQ(theta,0.0)) {
355 >        if (!FABSEQ(theta,0.0)) {
356                  sprintf(xf, " -ry %f", theta*(180./PI));
357                  while (*xf) ++xf;
358                  n += 2;
359          }
360          theta = atan2(xp[1], xp[0]);
361 <        if (!FEQ(theta,0.0)) {
361 >        if (!FABSEQ(theta,0.0)) {
362                  sprintf(xf, " -rz %f", theta*(180./PI));
363                  /* while (*xf) ++xf; */
364                  n += 2;
# Line 676 | Line 672 | convert_mgf(const char *mgfdata)
672   static int
673   rbf_headline(char *s, void *p)
674   {
675 <        char    fmt[64];
675 >        char    fmt[MAXFMTLEN];
676  
677          if (formatval(fmt, s)) {
678                  if (strcmp(fmt, BSDFREP_FMT))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines