gaussian_curvature.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 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_GAUSSIAN_CURVATURE_H
  9. #define IGL_GAUSSIAN_CURVATURE_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. /// Compute the 2π minus the sum of interior angles at each vertex. For
  15. /// interior vertices of a manifold mesh this corresponds to the local
  16. /// integral gaussian curvature ("angle deficit", without averaging by local
  17. /// area). For boundary vertices, this quantity is not so meaninful. FWIW,
  18. /// adding π to the output for boundary vertices would produce local integral
  19. /// geodesic curvature along the boundary curve.
  20. ///
  21. /// @param[in] V #V by 3 eigen Matrix of mesh vertex 3D positions
  22. /// @param[in] F #F by 3 eigen Matrix of face (triangle) indices
  23. /// @param[out] K #V by 1 eigen Matrix of discrete gaussian curvature values
  24. ///
  25. template <typename DerivedV, typename DerivedF, typename DerivedK>
  26. IGL_INLINE void gaussian_curvature(
  27. const Eigen::MatrixBase<DerivedV>& V,
  28. const Eigen::MatrixBase<DerivedF>& F,
  29. Eigen::PlainObjectBase<DerivedK> & K);
  30. }
  31. #ifndef IGL_STATIC_LIBRARY
  32. # include "gaussian_curvature.cpp"
  33. #endif
  34. #endif