straighten_seams.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #ifndef IGL_STRAIGHTEN_SEAMS_H
  2. #define IGL_STRAIGHTEN_SEAMS_H
  3. #include "igl_inline.h"
  4. #include <Eigen/Core>
  5. namespace igl
  6. {
  7. /// Given a obj-style mesh with (V,F) defining the geometric surface of the
  8. /// mesh and (VT,FT) defining the parameterization/texture-mapping of the mesh
  9. /// in the uv-domain, find all seams and boundaries in the texture-mapping and
  10. /// "straighten" them, remapping vertices along the boundary and in the
  11. /// interior. This will be careful to consistently straighten multiple seams
  12. /// in the texture-mesh corresponding to the same edge chains in the
  13. /// surface-mesh.
  14. ///
  15. ///
  16. /// @param[in] V #V by 3 list of vertices
  17. /// @param[in] F #F by 3 list of triangle indices
  18. /// @param[in] VT #VT by 2 list of texture coordinates
  19. /// @param[in] FT #F by 3 list of triangle texture coordinates
  20. /// @param[in] tol followed by Ramer-Douglas-Peucker tolerance as a fraction
  21. /// of the curves bounding box diagonal (see dpsimplify)
  22. /// @param[out] UE #UE by 2 list of indices into VT of coarse output polygon edges
  23. /// @param[out] UT #VT by 3 list of new texture coordinates
  24. /// @param[out] OT #OT by 2 list of indices into VT of boundary edges
  25. ///
  26. /// \see ramer_douglas_peucker
  27. template <
  28. typename DerivedV,
  29. typename DerivedF,
  30. typename DerivedVT,
  31. typename DerivedFT,
  32. typename Scalar,
  33. typename DerivedUE,
  34. typename DerivedUT,
  35. typename DerivedOT>
  36. IGL_INLINE void straighten_seams(
  37. const Eigen::MatrixBase<DerivedV> & V,
  38. const Eigen::MatrixBase<DerivedF> & F,
  39. const Eigen::MatrixBase<DerivedVT> & VT,
  40. const Eigen::MatrixBase<DerivedFT> & FT,
  41. const Scalar tol,
  42. Eigen::PlainObjectBase<DerivedUE> & UE,
  43. Eigen::PlainObjectBase<DerivedUT> & UT,
  44. Eigen::PlainObjectBase<DerivedOT> & OT);
  45. }
  46. #ifndef IGL_STATIC_LIBRARY
  47. # include "straighten_seams.cpp"
  48. #endif
  49. #endif