triangulate.cpp 785 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #include <test_common.h>
  2. #include <igl/copyleft/cgal/triangulate.h>
  3. #include <CGAL/Exact_predicates_exact_constructions_kernel.h>
  4. TEST_CASE("igl_copyleft_cgal_triangulate: sqannulus", "[igl/copyleft/cgal]")
  5. {
  6. Eigen::MatrixXd V(8,2);
  7. V<<0,0,3,0,3,3,0,3,
  8. 1,1,1,2,2,2,2,1;
  9. Eigen::MatrixXi E(8,2);
  10. E<<0,1,1,2,2,3,3,0,
  11. 4,5,5,6,6,7,7,4;
  12. Eigen::MatrixXd H(1,2);
  13. H<<1.5,1.5;
  14. Eigen::MatrixXd TV;
  15. Eigen::MatrixXi TF;
  16. igl::copyleft::cgal::triangulate<CGAL::Epeck>(V,E,H,false,TV,TF);
  17. Eigen::MatrixXd gt_TV(8,2);
  18. gt_TV<<
  19. 0,0,
  20. 3,0,
  21. 3,3,
  22. 0,3,
  23. 1,1,
  24. 1,2,
  25. 2,2,
  26. 2,1;
  27. Eigen::MatrixXi gt_TF(8,3);
  28. gt_TF<<
  29. 7,4,0,
  30. 7,0,1,
  31. 3,0,4,
  32. 3,5,6,
  33. 3,4,5,
  34. 2,6,1,
  35. 2,3,6,
  36. 6,7,1;
  37. test_common::assert_eq(TV,gt_TV);
  38. test_common::assert_eq(TF,gt_TF);
  39. }