You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is this a known limitation of the current intersection algorithm in VCGlib? Could it be caused by floating-point precision issues (e.g., epsilon thresholds)? And is there a recommended way to handle these edge cases robustly?To improve robustness, I suggest using a small epsilon tolerance when evaluating barycentric bounds, and optionally clamping u and v to the [0,1] range to handle near-edge cases more gracefully. For example:
if (v < -EPSIL || u + v > T(1.0) + EPSIL) return false;
if (u < 0) u = 0;
if (u > 1) u = 1;
if (v < 0) v = 0;
if (v > 1) v = 1;
This helps mitigate failures in situations where the ray should conceptually intersect the triangle, but fails due to minor numerical inaccuracies.