PMP: compute_face_normal() of degenerate faces
Issue Details
In this testsuite we get an assertion that the normal of a degenerate face is not the null vector. It seems that the algorithm does not check if a face is degenerate but computes something.
At the same time the platform has several errors for other packages, comparing numerical results.
Environment
- Operating system (Windows/Mac/Linux, 32/64 bits): Linux
- Compiler: Clang 14.0.6
- Release or debug mode:
- Specific flags used (if any):
- CGAL version: master
- Boost version:
- Other libraries versions if used (Eigen, TBB, etc.):
IIRC we had discussed with @MaelRL that it makes no sense to return NULL_VECTOR as the normal of a degenerate face. But the test seems to think the other way around...
But what would be the better choice? Also not only that the test thinks it, but it is only one platform where this triggers an assertion.
The problem is that for certain doubles a * b - b * a does not equal 0. The cross product does exactly that in the case of identical vectors. As Laurent pointed out, intermediate results may be stored as a double or in a FPU register with higher precision. Storing both products explicitly in a double resolves the problem.