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

Comparing ray/src/ot/sphere.c (file contents):
Revision 1.2 by greg, Sat Oct 14 11:19:36 1989 UTC vs.
Revision 1.3 by greg, Wed May 22 17:01:43 1991 UTC

# Line 64 | Line 64 | register CUBE  *cu;
64   #define  cent           fa
65   #define  rad            fa[3]
66                                          /* get arguments */
67 +        if (o->oargs.nfargs != 4)
68 +                objerror(o, USER, "bad # arguments");
69          fa = o->oargs.farg;
70 <        if (o->oargs.nfargs != 4 || rad <= FTINY)
71 <                objerror(o, USER, "bad arguments");
70 >        if (rad < -FTINY) {
71 >                objerror(o, WARNING, "negative radius");
72 >                o->otype = o->otype == OBJ_SPHERE ?
73 >                                OBJ_BUBBLE : OBJ_SPHERE;
74 >                rad = -rad;
75 >        } else if (rad <= FTINY)
76 >                objerror(o, USER, "zero radius");
77  
78          d1 = ROOT3/2.0 * cu->cusize;    /* bounding radius for cube */
79  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines