Forráskód Böngészése

Throw exception if degenerate triangles are present.

Former-commit-id: 6c1f96edf4241e3f58740e438d46a3bbf8282b25
Qingnan Zhou 8 éve
szülő
commit
b749aba09c
1 módosított fájl, 3 hozzáadás és 2 törlés
  1. 3 2
      include/igl/copyleft/cgal/extract_feature.cpp

+ 3 - 2
include/igl/copyleft/cgal/extract_feature.cpp

@@ -97,11 +97,12 @@ IGL_INLINE void igl::copyleft::cgal::extract_feature(
         return CGAL::compare_dihedral_angle(p0, p1, p3, p2, cos_tol) ==
           CGAL::SMALLER;
       case CGAL::COPLANAR:
-        if (!CGAL::collinear(p0, p1, p2) && CGAL::collinear(p0, p1, p3)) {
+        if (!CGAL::collinear(p0, p1, p2) && !CGAL::collinear(p0, p1, p3)) {
           return CGAL::compare_dihedral_angle(p0, p1, p2, p3, cos_tol) ==
             CGAL::SMALLER;
         } else {
-          return false;
+          throw "Dihedral angle (and feature edge) is not well defined for"
+              " degenerate triangles!";
         }
       default:
         throw "Unknown CGAL orientation";