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

Comparing ray/src/common/face.c (file contents):
Revision 2.16 by greg, Tue Feb 16 16:48:11 2021 UTC vs.
Revision 2.17 by greg, Sun Aug 18 00:06:10 2024 UTC

# Line 140 | Line 140 | inface(                                /* determine if point is in face */
140          ncross = 0;
141                                          /* positive x axis cross test */
142          while (n--) {
143 +                if (FRELEQ(p0[yi], y) && FRELEQ(p1[yi], y) &&
144 +                                (p0[xi] > x) ^ (p1[xi] > x))
145 +                        return(1);                      /* edge case #1 */
146                  if ((p0[yi] > y) ^ (p1[yi] > y)) {
147                          tst = (p0[xi] > x) + (p1[xi] > x);
148                          if (tst == 2)
# Line 148 | Line 151 | inface(                                /* determine if point is in face */
151                                  double  prodA = (p0[yi]-y)*(p1[xi]-x);
152                                  double  prodB = (p0[xi]-x)*(p1[yi]-y);
153                                  if (FRELEQ(prodA, prodB))
154 <                                        return(1);      /* edge case #1 */
154 >                                        return(1);      /* edge case #2 */
155                                  ncross += (p1[yi] > p0[yi]) ^ (prodA > prodB);
156                          } else if (FRELEQ(p0[xi], x) && FRELEQ(p1[xi], x))
157 <                                return(1);              /* edge case #2 */
158 <                } else if (FRELEQ(p0[yi], y) && FRELEQ(p1[yi], y) &&
156 <                                (p0[xi] > x) ^ (p1[xi] > x))
157 <                        return(1);                      /* edge case #3 */
157 >                                return(1);              /* edge case #3 */
158 >                }
159                  p0 = p1;
160                  p1 += 3;
161          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines