cdt.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef IGL_TRIANGLE_CDT_H
  2. #define IGL_TRIANGLE_CDT_H
  3. #include "../igl_inline.h"
  4. #include <Eigen/Core>
  5. namespace igl
  6. {
  7. namespace triangle
  8. {
  9. /// Construct the constrained delaunay triangulation of the convex hull
  10. /// of a given set of points and segments in 2D. This differs from a direct
  11. /// call to triangulate because it will preprocess the input to remove
  12. /// duplicates and return an adjusted segment list on the output.
  13. ///
  14. /// @param[in] V #V by 2 list of texture mesh vertices
  15. /// @param[in] E #E by 2 list of constraint edge indices into V
  16. /// @param[in] flags string of triangle flags should contain "-c" unless the
  17. /// some subset of segments are known to enclose all other
  18. /// points/segments.
  19. /// @param[out] WV #WV by 2 list of background mesh vertices
  20. /// @param[out] WF #WF by 2 list of background mesh triangle indices into WV
  21. /// @param[out] WE #WE by 2 list of constraint edge indices into WV (might be smaller
  22. /// than E because degenerate constraints have been removed)
  23. /// @param[out] J #V list of indices into WF/WE for each vertex in V
  24. ///
  25. template <
  26. typename DerivedV,
  27. typename DerivedE,
  28. typename DerivedWV,
  29. typename DerivedWF,
  30. typename DerivedWE,
  31. typename DerivedJ>
  32. IGL_INLINE void cdt(
  33. const Eigen::MatrixBase<DerivedV> & V,
  34. const Eigen::MatrixBase<DerivedE> & E,
  35. const std::string & flags,
  36. Eigen::PlainObjectBase<DerivedWV> & WV,
  37. Eigen::PlainObjectBase<DerivedWF> & WF,
  38. Eigen::PlainObjectBase<DerivedWE> & WE,
  39. Eigen::PlainObjectBase<DerivedJ> & J);
  40. }
  41. }
  42. #ifndef IGL_STATIC_LIBRARY
  43. #include "cdt.cpp"
  44. #endif
  45. #endif