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

Comparing ray/src/hd/rholo.c (file contents):
Revision 3.36 by gregl, Sat Jan 10 16:37:10 1998 UTC vs.
Revision 3.37 by gregl, Fri Jan 16 11:45:43 1998 UTC

# Line 332 | Line 332 | register HDGRID        *gp;
332          extern char     *atos();
333          register int    i;
334          int     n;
335 <        double  len[3], maxlen, d;
335 >        double  len[3], d;
336          char    buf[64];
337  
338          if (!vdef(SECTION)) {
# Line 366 | Line 366 | register HDGRID        *gp;
366                                  &gp->xv[2][0], &gp->xv[2][1], &gp->xv[2][2],
367                                  &gp->grid[0], &gp->grid[1], &gp->grid[2]) < 12)
368                          badvalue(SECTION);
369                maxlen = 0.;
369                  for (i = 0; i < 3; i++)
370 <                        if ((len[i] = VLEN(gp->xv[i])) > maxlen)
371 <                                maxlen = len[i];
372 <                if (!vdef(GRID))
373 <                        d = 0.125*maxlen;
374 <                else if ((d = vflt(GRID)) <= FTINY)
370 >                        len[i] = VLEN(gp->xv[i]);
371 >                if (!vdef(GRID)) {
372 >                        d = 2/5e5*( len[0]*len[0]*(len[1]*len[1] +
373 >                                        len[2]*len[2] + 4*len[1]*len[2])
374 >                                + len[1]*len[1]*len[2]*(len[2] + 4*len[0])
375 >                                + 4*len[0]*len[1]*len[2]*len[2] );
376 >                        d = sqrt(sqrt(d));
377 >                } else if ((d = vflt(GRID)) <= FTINY)
378                          badvalue(GRID);
379                  for (i = 0; i < 3; i++)
380                          if (gp->grid[i] <= 0)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines