Download vendor/libigl/tests/include/igl/cut_mesh.cpp from AVSim/simulation-package: direct link, hf CLI and curl.
- Browser
- Download file 1.46 kB
-
https://huggingface.co/datasets/AVSim/simulation-package/resolve/main/vendor/libigl/tests/include/igl/cut_mesh.cpp
- Command line
-
hf download hf://datasets/AVSim/simulation-package/vendor/libigl/tests/include/igl/cut_mesh.cpp
-
curl -L -o cut_mesh.cpp https://huggingface.co/datasets/AVSim/simulation-package/resolve/main/vendor/libigl/tests/include/igl/cut_mesh.cpp
1.46 kB
| TEST_CASE("seperate mesh", "[igl]") { | |
| Eigen::MatrixXd V(9,3); | |
| V << 0,0,0, | |
| 0,1,0, | |
| 0,2,0, | |
| 1,2,0, | |
| 2,2,0, | |
| 2,1,0, | |
| 2,0,0, | |
| 1,0,0, | |
| 1,1,0; | |
| Eigen::MatrixXi F(8,3); | |
| F << 0,1,8, | |
| 1,2,8, | |
| 2,3,8, | |
| 3,4,8, | |
| 4,5,8, | |
| 5,6,8, | |
| 6,7,8, | |
| 7,0,8; | |
| Eigen::MatrixXi C(8,3); | |
| C << 0,1,1, | |
| 0,1,1, | |
| 0,0,1, | |
| 0,0,0, | |
| 0,0,0, | |
| 0,0,0, | |
| 0,0,0, | |
| 0,1,0; | |
| Eigen::VectorXi I; | |
| igl::cut_mesh(V,F,C,I); | |
| Eigen::VectorXi count; | |
| igl::vertex_components(F, count); | |
| REQUIRE(count.maxCoeff() == 2); | |
| } | |
| TEST_CASE("single edge", "[igl]") { | |
| Eigen::MatrixXd V(9,3); | |
| V << 0,0,0, | |
| 0,1,0, | |
| 0,2,0, | |
| 1,2,0, | |
| 2,2,0, | |
| 2,1,0, | |
| 2,0,0, | |
| 1,0,0, | |
| 1,1,0; | |
| Eigen::MatrixXi F(8,3); | |
| F << 0,1,8, | |
| 1,2,8, | |
| 2,3,8, | |
| 3,4,8, | |
| 4,5,8, | |
| 5,6,8, | |
| 6,7,8, | |
| 7,0,8; | |
| Eigen::MatrixXi C(8,3); | |
| C << 0,1,0, | |
| 0,0,1, | |
| 0,0,0, | |
| 0,0,0, | |
| 0,0,0, | |
| 0,0,0, | |
| 0,0,0, | |
| 0,0,0; | |
| Eigen::VectorXi I; | |
| igl::cut_mesh(V,F,C,I); | |
| Eigen::VectorXi count; | |
| igl::vertex_components(F, count); | |
| REQUIRE(0 == count.maxCoeff()); | |
| Eigen::MatrixXi E; | |
| igl::edges(F, E); | |
| const auto euler = V.rows() - E.rows() + F.rows(); | |
| REQUIRE ( 1 == euler ); | |
| } |