intrinsic_delaunay_cotmatrix.h 1.9 KB

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