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

Comparing ray/src/cv/rad2mgf.c (file contents):
Revision 2.12 by greg, Wed May 10 19:46:05 1995 UTC vs.
Revision 2.16 by greg, Sat Feb 22 02:07:23 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1995 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   * Convert Radiance scene description to MGF
6   */
7  
8 < #include <stdio.h>
12 < #include <math.h>
8 > #include "standard.h"
9   #include <ctype.h>
10   #include <string.h>
15 #include "fvect.h"
11   #include "object.h"
12   #include "color.h"
13   #include "lookup.h"
14  
20 #define PI      3.14159265358979323846
21
15   #define C_1SIDEDTHICK   0.005
16  
17   int     o_face(), o_cone(), o_sphere(), o_ring(), o_cylinder();
# Line 26 | Line 19 | int    o_instance(), o_illum();
19   int     o_plastic(), o_metal(), o_glass(), o_dielectric(),
20          o_mirror(), o_trans(), o_light();
21  
29 extern void     free();
30 extern char     *malloc();
31
22   LUTAB   rmats = LU_SINIT(free,NULL);            /* defined material table */
23  
24   LUTAB   rdispatch = LU_SINIT(NULL,NULL);        /* function dispatch table */
# Line 431 | Line 421 | o_face(mod, typ, id, fa)               /* print out a polygon */
421   char    *mod, *typ, *id;
422   FUNARGS *fa;
423   {
424 <        char    entbuf[512];
424 >        char    entbuf[2048], *linestart;
425          register char   *cp;
426          register int    i;
427  
# Line 439 | Line 429 | FUNARGS        *fa;
429                  return(-1);
430          setmat(mod);
431          setobj(id);
432 <        cp = entbuf;
432 >        cp = linestart = entbuf;
433          *cp++ = 'f';
434          for (i = 0; i < fa->nfargs; i += 3) {
435                  *cp++ = ' ';
436 +                if (cp - linestart > 72) {
437 +                        *cp++ = '\\'; *cp++ = '\n';
438 +                        linestart = cp;
439 +                        *cp++ = ' '; *cp++ = ' ';
440 +                }
441                  getvertid(cp, fa->farg + i);
442                  while (*cp)
443                          cp++;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines