소스 검색

Merge pull request #380 from jmespadero/boundaryBug

Bugfix: boundary_loop crash on meshes without boundary
Former-commit-id: 9b91f679f6b2238101558fe91ae6c476931bb9a8
Alec Jacobson 8 년 전
부모
커밋
2270943a19
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      include/igl/boundary_loop.cpp

+ 7 - 0
include/igl/boundary_loop.cpp

@@ -114,6 +114,13 @@ IGL_INLINE void igl::boundary_loop(
     }
   }
 
+  //Check for meshes without boundary
+  if (idxMax == -1)
+  {
+      L.clear();
+      return;
+  }
+
   L.resize(Lall[idxMax].size());
   for (size_t i = 0; i < Lall[idxMax].size(); ++i)
   {