mesh_to_polyhedron.cpp 1.1 KB

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