for(int j = 0 ; j < 2; ++j)
{
const int dpIdx = DP_INDEX[3*facets[j] + i];
- const DoubleProduct dp = DP_FOR_SEG_FACET_INTERSECTION[dpIdx];
- const double sign = SIGN_FOR_SEG_FACET_INTERSECTION[dpIdx];
- c[j] = dpIdx < 0.0 ? 0.0 : sign * calcStableC(seg, dp);
+ if (dpIdx != -1)
+ {
+ const DoubleProduct dp = DP_FOR_SEG_FACET_INTERSECTION[dpIdx];
+ const double sign = SIGN_FOR_SEG_FACET_INTERSECTION[dpIdx];
+ c[j] = sign * calcStableC(seg, dp);
+ }
+ else
+ c[j] = 0.0;
}
pt[i] = (c[0] * s[0] + c[1] * s[1]) / denominator;