Browse Source

Add cut to disk unittest (#1007)

* Add failing unit test for https://github.com/libigl/libigl/pull/984.

* Update test data repo.

* Remove check on number of cuts since boundary may also be reported as cut.

* Update unittest tag.

* Update LibiglDownloadExternal.cmake
Qingnan Zhou 6 years ago
parent
commit
626aeba4bd
2 changed files with 15 additions and 1 deletions
  1. 1 1
      cmake/LibiglDownloadExternal.cmake
  2. 14 0
      tests/include/igl/cut_to_disk.cpp

+ 1 - 1
cmake/LibiglDownloadExternal.cmake

@@ -153,7 +153,7 @@ function(igl_download_test_data)
 		DOWNLOAD_DIR ${LIBIGL_EXTERNAL}/.cache/test_data
 		DOWNLOAD_DIR ${LIBIGL_EXTERNAL}/.cache/test_data
 		QUIET
 		QUIET
 		GIT_REPOSITORY https://github.com/libigl/libigl-tests-data
 		GIT_REPOSITORY https://github.com/libigl/libigl-tests-data
-		GIT_TAG        c81bb3b3db4cfd78bac6d359d845c45bc1059c9a
+		GIT_TAG        c01017b0c73734c0807c95563628ad2754efb462
 		${LIBIGL_EXTRA_OPTIONS}
 		${LIBIGL_EXTRA_OPTIONS}
 	)
 	)
 endfunction()
 endfunction()

+ 14 - 0
tests/include/igl/cut_to_disk.cpp

@@ -130,3 +130,17 @@ TEST_CASE("cut_to_disk: cube", "[igl]")
 
 
   cut_to_disk_helper::assert_is_disk(V, F, cuts);
   cut_to_disk_helper::assert_is_disk(V, F, cuts);
 }
 }
+
+TEST_CASE("cut_to_disk: annulus", "[igl]") {
+  // Unit test for https://github.com/libigl/libigl/pull/984
+  using namespace igl;
+  Eigen::MatrixXd V;
+  Eigen::MatrixXi F;
+  test_common::load_mesh("annulus.obj", V, F);
+
+  std::vector<std::vector<int>> cuts;
+  cut_to_disk(F, cuts);
+
+  cut_to_disk_helper::assert_is_disk(V, F, cuts);
+}
+