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

Comparing ray/src/cv/mgf2inv.c (file contents):
Revision 2.1 by greg, Fri Feb 18 00:40:25 2011 UTC vs.
Revision 2.5 by greg, Mon Nov 20 18:32:11 2023 UTC

# Line 17 | Line 17 | static const char      RCSid[] = "$Id$";
17  
18   #include <string.h>
19  
20 + #include "color.h"
21 +
22   #include "mgf_parser.h"
23  
24   #include "lookup.h"
# Line 29 | Line 31 | static const char      RCSid[] = "$Id$";
31  
32   #define VERTFMT         "%+16.9e %+16.9e %+16.9e\n%+6.3f %+6.3f %+6.3f"
33   #define VZVECT          "+0.000 +0.000 +0.000"
34 < #define VFSEPPOS        50      /* position of newline in above */
33 < #define VFLEN           72      /* total vertex string length */
34 > #define VFLEN           92      /* total vertex string length */
35   #define MAXVERT         10240   /* maximum cached vertices */
36  
37   #define setvkey(k,v)    sprintf(k,VERTFMT,(v)->p[0],(v)->p[1],(v)->p[2],\
# Line 487 | Line 488 | i_cyl(                 /* translate a cylinder description */
488          va[0] = v2->p[0] - v1->p[0];
489          va[1] = v2->p[1] - v1->p[1];
490          va[2] = v2->p[2] - v1->p[2];
491 <        length = sqrt(DOT(va,va));
492 <        if (va[1] >= length)
492 <                angle = 0.;
493 <        else if (va[1] <= -length)
494 <                angle = PI;
495 <        else
496 <                angle = acos(va[1]/length);
491 >        length = VLEN(va);
492 >        angle = Acos(va[1]/length);
493          printf("%sTranslation { translation %13.9g %13.9g %13.9g }\n", tabs,
494                          .5*(v1->p[0]+v2->p[0]), .5*(v1->p[1]+v2->p[1]),
495                          .5*(v1->p[2]+v2->p[2]));
# Line 529 | Line 525 | to_id(                 /* make sure a name is a valid Inventor ID */
525   void
526   flush_cache(void)                       /* put out cached faces */
527   {
528 +        int     VFSEPPOS = strchr(vlist[0],'\n') - vlist[0];
529          int     donorms = 0;
530          register struct face    *f;
531          register int    i;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines