mesh_to_polyhedron.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #include <test_common.h>
  2. #include <igl/copyleft/cgal/mesh_to_polyhedron.h>
  3. #include <CGAL/Simple_cartesian.h>
  4. #include <CGAL/Polyhedron_3.h>
  5. #include <CGAL/Polyhedron_items_with_id_3.h>
  6. TEST_CASE(
  7. "igl_copyleft_cgal_mesh_to_polyhedron: positive",
  8. "[igl/copyleft/cgal/]")
  9. {
  10. const auto test_case = [](const std::string &param)
  11. {
  12. Eigen::MatrixXd V;
  13. Eigen::MatrixXi F;
  14. test_common::load_mesh(param, V, F);
  15. CGAL::Polyhedron_3<
  16. CGAL::Simple_cartesian<double>,
  17. CGAL::Polyhedron_items_with_id_3,
  18. CGAL::HalfedgeDS_default,
  19. std::allocator<int> >
  20. poly;
  21. REQUIRE ( igl::copyleft::cgal::mesh_to_polyhedron(V,F,poly) );
  22. };
  23. test_common::run_test_cases(test_common::manifold_meshes(), test_case);
  24. }
  25. TEST_CASE(
  26. "igl_copyleft_cgal_mesh_to_polyhedron: negative",
  27. "[igl/copyleft/cgal/]")
  28. {
  29. Eigen::MatrixXd V;
  30. Eigen::MatrixXi F;
  31. test_common::load_mesh("truck.obj", V, F);
  32. CGAL::Polyhedron_3<
  33. CGAL::Simple_cartesian<double>,
  34. CGAL::Polyhedron_items_with_id_3,
  35. CGAL::HalfedgeDS_default,
  36. std::allocator<int> >
  37. poly;
  38. REQUIRE (! igl::copyleft::cgal::mesh_to_polyhedron(V,F,poly) );
  39. }