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

Comparing ray/src/gen/replmarks.c (file contents):
Revision 2.15 by greg, Fri Jan 25 02:11:13 2008 UTC vs.
Revision 2.20 by greg, Tue Apr 22 14:51:29 2025 UTC

# Line 14 | Line 14 | static const char RCSid[] = "$Id$";
14  
15   #include "platform.h"
16   #include "rtio.h"
17 < #include "rtprocess.h"
17 > #include "paths.h"
18   #include "fvect.h"
19  
20   #ifdef  M_PI
# Line 23 | Line 23 | static const char RCSid[] = "$Id$";
23   #define  PI             3.14159265358979323846
24   #endif
25  
26 #define  FEQ(a,b)       ((a)-(b) <= 1e-7 && (b)-(a) <= 1e-7)
27
26   #define  MAXVERT        6       /* maximum number of vertices for markers */
27   #define  MAXMARK        128     /* maximum number of markers */
28  
# Line 185 | Line 183 | cvcomm(                /* convert a command */
183                          exit(1);
184                  }
185                  convert(buf, pin);
186 <                pclose(pin);
186 >                if (pclose(pin) != 0)
187 >                        fprintf(stderr,
188 >                        "%s: (%s): warning - bad status from \"%s\"\n",
189 >                                        progname, fname, buf);
190          } else
191                  printf("\n%s\n", buf);
192   }
# Line 401 | Line 402 | addrot(                /* compute rotation (x,y,z) => (xp,yp,zp) */
402          }
403          n = 0;
404          theta = atan2(yp[2], zp[2]);
405 <        if (!FEQ(theta,0.0)) {
405 >        if (!FABSEQ(theta,0.0)) {
406                  sprintf(xf, " -rx %f", theta*(180./PI));
407                  while (*xf) ++xf;
408                  n += 2;
409          }
410 <        theta = asin(-xp[2]);
411 <        if (!FEQ(theta,0.0)) {
410 >        theta = Asin(-xp[2]);
411 >        if (!FABSEQ(theta,0.0)) {
412                  sprintf(xf, " -ry %f", theta*(180./PI));
413                  while (*xf) ++xf;
414                  n += 2;
415          }
416          theta = atan2(xp[1], xp[0]);
417 <        if (!FEQ(theta,0.0)) {
417 >        if (!FABSEQ(theta,0.0)) {
418                  sprintf(xf, " -rz %f", theta*(180./PI));
419                  /* while (*xf) ++xf; */
420                  n += 2;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines