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.4 by greg, Thu Mar 6 00:40:37 2014 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines