triangulate.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2021 Alec Jacobson
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. #ifndef IGL_COPYLEFT_CGAL_TRIANGULATE_H
  9. #define IGL_COPYLEFT_CGAL_TRIANGULATE_H
  10. #include "../../igl_inline.h"
  11. #include <string>
  12. #include <Eigen/Core>
  13. namespace igl
  14. {
  15. namespace copyleft
  16. {
  17. namespace cgal
  18. {
  19. /// Triangulate the interior of a polygon using CGAL
  20. ///
  21. /// @param[in] V #V by 2 list of 2D vertex positions
  22. /// @param[in] E #E by 2 list of vertex ids forming unoriented edges of the boundary of the polygon
  23. /// @param[in] H #H by 2 coordinates of points contained inside holes of the polygon
  24. /// @param[in] retain_convex_hull whether to retain convex hull {true} or trim away
  25. /// all faces reachable from infinite by traversing across
  26. /// non-constrained edges {false}. {true → "c" flag in `triangle`}
  27. /// @param[out] V2 #V2 by 2 coordinates of the vertives of the generated triangulation
  28. /// @param[out] F2 #F2 by 3 list of indices forming the faces of the generated triangulation
  29. ///
  30. /// \see igl::triangle::triangulate
  31. template <
  32. typename Kernel,
  33. typename DerivedV,
  34. typename DerivedE,
  35. typename DerivedH,
  36. typename DerivedV2,
  37. typename DerivedF2>
  38. IGL_INLINE void triangulate(
  39. const Eigen::MatrixBase<DerivedV> & V,
  40. const Eigen::MatrixBase<DerivedE> & E,
  41. const Eigen::MatrixBase<DerivedH> & H,
  42. const bool retain_convex_hull,
  43. Eigen::PlainObjectBase<DerivedV2> & V2,
  44. Eigen::PlainObjectBase<DerivedF2> & F2);
  45. }
  46. }
  47. }
  48. #ifndef IGL_STATIC_LIBRARY
  49. # include "triangulate.cpp"
  50. #endif
  51. #endif