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.19 by greg, Tue Apr 22 04:45:25 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): bad status from \"%s\"\n",
189 >                                        progname, fname, buf);
190 >                        exit(1);
191 >                }
192          } else
193                  printf("\n%s\n", buf);
194   }
# Line 401 | Line 404 | addrot(                /* compute rotation (x,y,z) => (xp,yp,zp) */
404          }
405          n = 0;
406          theta = atan2(yp[2], zp[2]);
407 <        if (!FEQ(theta,0.0)) {
407 >        if (!FABSEQ(theta,0.0)) {
408                  sprintf(xf, " -rx %f", theta*(180./PI));
409                  while (*xf) ++xf;
410                  n += 2;
411          }
412 <        theta = asin(-xp[2]);
413 <        if (!FEQ(theta,0.0)) {
412 >        theta = Asin(-xp[2]);
413 >        if (!FABSEQ(theta,0.0)) {
414                  sprintf(xf, " -ry %f", theta*(180./PI));
415                  while (*xf) ++xf;
416                  n += 2;
417          }
418          theta = atan2(xp[1], xp[0]);
419 <        if (!FEQ(theta,0.0)) {
419 >        if (!FABSEQ(theta,0.0)) {
420                  sprintf(xf, " -rz %f", theta*(180./PI));
421                  /* while (*xf) ++xf; */
422                  n += 2;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines