Skip to content

Commit

Permalink
Merge pull request #5002 from AjinkyaDahale/fix-4732-self-int
Browse files Browse the repository at this point in the history
[Mesh] Avoid false negatives during self-intersection checks
  • Loading branch information
yorikvanhavre committed Sep 8, 2021
2 parents 67a603f + 11f89dd commit 642836d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Mod/Mesh/App/Core/Elements.cpp
Expand Up @@ -988,6 +988,12 @@ int MeshGeomFacet::IntersectWithFacet (const MeshGeomFacet& rclFacet,
rclPt0.x = isectpt1[0]; rclPt0.y = isectpt1[1]; rclPt0.z = isectpt1[2];
rclPt1.x = isectpt2[0]; rclPt1.y = isectpt2[1]; rclPt1.z = isectpt2[2];

// Note: tri_tri_intersect_with_isection() does not return line of
// intersection when triangles are coplanar. See tritritest.h:18 and 658.
// So rclPt* may be garbage values and we cannot continue.
if (coplanar)
return 2; // equivalent to rclPt0 != rclPt1

// With extremely acute-angled triangles it may happen that the algorithm
// claims an intersection but the intersection points are far outside the
// model. So, a plausibility check is to verify that the intersection points
Expand Down

0 comments on commit 642836d

Please sign in to comment.