normal_derivative.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2015 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_NORMAL_DERIVATIVE_H
  9. #define IGL_NORMAL_DERIVATIVE_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. #include <Eigen/Sparse>
  13. namespace igl
  14. {
  15. /// Computes the directional derivative **normal** to
  16. /// **all** (half-)edges of a triangle mesh (not just boundary edges). These
  17. /// are integrated along the edge: they're the per-face constant gradient dot
  18. /// the rotated edge vector (unit rotated edge vector for direction then
  19. /// magnitude for integration).
  20. ///
  21. /// @param[in] V #V by dim list of mesh vertex positions
  22. /// @param[in] F #F by 3|4 list of triangle|tetrahedron indices into V
  23. /// @param[out] DD #F*3|4 by #V sparse matrix representing operator to compute
  24. /// directional derivative with respect to each facet of each element.
  25. template <
  26. typename DerivedV,
  27. typename DerivedEle,
  28. typename Scalar>
  29. IGL_INLINE void normal_derivative(
  30. const Eigen::MatrixBase<DerivedV> & V,
  31. const Eigen::MatrixBase<DerivedEle> & Ele,
  32. Eigen::SparseMatrix<Scalar>& DD);
  33. }
  34. #ifndef IGL_STATIC_LIBRARY
  35. # include "normal_derivative.cpp"
  36. #endif
  37. #endif