predicates.cpp 1010 B

12345678910111213141516171819202122232425262728293031
  1. #include <test_common.h>
  2. #include <igl/predicates/exactinit.h>
  3. #include <igl/triangle/triangulate.h>
  4. #include <limits>
  5. TEST_CASE("predicates and triangle", "[igl][predicates][triangle]") {
  6. using namespace igl::predicates;
  7. using Scalar = double;
  8. igl::predicates::exactinit();
  9. SECTION("Predicate and triangle") {
  10. Eigen::Matrix<double, -1, -1> vertices(4, 2);
  11. Eigen::Matrix<double, -1, -1> holes;
  12. Eigen::Matrix<int, -1, -1> edges;
  13. vertices << 0.0, 0.0,
  14. 1.0, 0.0,
  15. 0.0, 1.0,
  16. 1.0, 1.0;
  17. Eigen::Matrix<double, -1, -1> out_vertices;
  18. Eigen::Matrix<int, -1, -1> out_faces;
  19. // Run constrained Delaunay.
  20. igl::triangle::triangulate(vertices, edges, holes, "QcYY",
  21. out_vertices, out_faces);
  22. REQUIRE(out_vertices.rows() == 4);
  23. REQUIRE(out_vertices.cols() == 2);
  24. REQUIRE(out_faces.rows() == 2);
  25. REQUIRE(out_faces.cols() == 3);
  26. }
  27. }