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

Comparing ray/src/rt/srcsupp.c (file contents):
Revision 2.22 by greg, Thu May 21 05:54:54 2015 UTC vs.
Revision 2.23 by greg, Thu Apr 21 00:40:35 2016 UTC

# Line 98 | Line 98 | fsetsrc(                       /* set a face as a source */
98          src->so = so;
99                                                  /* get the face */
100          f = getface(so);
101 <        if (f->area == 0.0)
101 >        if (f->area == 0.)
102                  objerror(so, USER, "zero source area");
103                                                  /* find the center */
104          for (j = 0; j < 3; j++) {
# Line 196 | Line 196 | rsetsrc(                       /* set a ring (disk) as a source */
196          src->so = so;
197                                                  /* get the ring */
198          co = getcone(so, 0);
199 +        if (co == NULL)
200 +                objerror(so, USER, "illegal source");
201          if (CO_R1(co) <= FTINY)
202                  objerror(so, USER, "illegal source radius");
203          VCOPY(src->sloc, CO_P0(co));
# Line 222 | Line 224 | cylsetsrc(                     /* set a cylinder as a source */
224          src->so = so;
225                                                  /* get the cylinder */
226          co = getcone(so, 0);
227 +        if (co == NULL)
228 +                objerror(so, USER, "illegal source");
229          if (CO_R0(co) <= FTINY)
230                  objerror(so, USER, "illegal source radius");
231          if (CO_R0(co) > .2*co->al)              /* heuristic constraint */
# Line 336 | Line 340 | rgetmaxdisk(           /* get center and squared radius of ring
340          CONE  *co;
341          
342          co = getcone(op, 0);
343 +        if (co == NULL)
344 +                return(0.);
345          VCOPY(ocent, CO_P0(co));
346          return(CO_R1(co)*CO_R1(co));
347   }
# Line 364 | Line 370 | rgetplaneq(                    /* get plane equation for ring */
370          CONE  *co;
371  
372          co = getcone(op, 0);
373 +        if (co == NULL) {
374 +                memset(nvec, 0, sizeof(FVECT));
375 +                return(0.);
376 +        }
377          VCOPY(nvec, co->ad);
378          return(DOT(nvec, CO_P0(co)));
379   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines