grad_intrinsic.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  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_GRAD_INTRINSIC_H
  9. #define IGL_GRAD_INTRINSIC_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. #include <Eigen/Sparse>
  13. namespace igl {
  14. // GRAD_INTRINSIC Construct an intrinsic gradient operator.
  15. //
  16. // Inputs:
  17. // l #F by 3 list of edge lengths
  18. // F #F by 3 list of triangle indices into some vertex list V
  19. // Outputs:
  20. // G #F*2 by #V gradient matrix: G=[Gx;Gy] where x runs along the 23 edge and
  21. // y runs in the counter-clockwise 90° rotation.
  22. template <typename Derivedl, typename DerivedF, typename Gtype>
  23. IGL_INLINE void grad_intrinsic(
  24. const Eigen::MatrixBase<Derivedl>&l,
  25. const Eigen::MatrixBase<DerivedF>&F,
  26. Eigen::SparseMatrix<Gtype> &G);
  27. }
  28. #ifndef IGL_STATIC_LIBRARY
  29. # include "grad_intrinsic.cpp"
  30. #endif
  31. #endif