intrinsic_delaunay_cotmatrix.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2018 Alec Jacobson <[email protected]>
  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_INTRINSIC_DELAUNAY_COTMATRIX_H
  9. #define IGL_INTRINSIC_DELAUNAY_COTMATRIX_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. #include <Eigen/Sparse>
  13. namespace igl
  14. {
  15. /// Computes the discrete cotangent Laplacian of a mesh after converting it
  16. /// into its intrinsic Delaunay triangulation (see, e.g., [Fisher et al.
  17. /// 2007].
  18. ///
  19. /// @param[in] V #V by dim list of mesh vertex positions
  20. /// @param[in] F #F by 3 list of mesh elements (triangles or tetrahedra)
  21. /// @param[out] L #V by #V cotangent matrix, each row i corresponding to V(i,:)
  22. /// @param[out] l_intrinsic #F by 3 list of intrinsic edge-lengths used to compute L
  23. /// @param[out] F_intrinsic #F by 3 list of intrinsic face indices used to compute L
  24. ///
  25. /// \see intrinsic_delaunay_triangulation, cotmatrix, cotmatrix_intrinsic
  26. template <
  27. typename DerivedV,
  28. typename DerivedF,
  29. typename Scalar,
  30. typename Derivedl_intrinsic,
  31. typename DerivedF_intrinsic>
  32. IGL_INLINE void intrinsic_delaunay_cotmatrix(
  33. const Eigen::MatrixBase<DerivedV> & V,
  34. const Eigen::MatrixBase<DerivedF> & F,
  35. Eigen::SparseMatrix<Scalar>& L,
  36. Eigen::PlainObjectBase<Derivedl_intrinsic> & l_intrinsic,
  37. Eigen::PlainObjectBase<DerivedF_intrinsic> & F_intrinsic);
  38. /// \overload
  39. template <typename DerivedV, typename DerivedF, typename Scalar>
  40. IGL_INLINE void intrinsic_delaunay_cotmatrix(
  41. const Eigen::MatrixBase<DerivedV> & V,
  42. const Eigen::MatrixBase<DerivedF> & F,
  43. Eigen::SparseMatrix<Scalar>& L);
  44. }
  45. #ifndef IGL_STATIC_LIBRARY
  46. # include "intrinsic_delaunay_cotmatrix.cpp"
  47. #endif
  48. #endif