vector_area_matrix.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2014 Daniele Panozzo <[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_VECTOR_AREA_MATRIX_H
  9. #define IGL_VECTOR_AREA_MATRIX_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Dense>
  12. #include <Eigen/Sparse>
  13. namespace igl
  14. {
  15. /// Constructs the symmetric area matrix A, s.t. [V.col(0)' V.col(1)'] * A *
  16. /// [V.col(0); V.col(1)] is the **vector area** of the mesh (V,F).
  17. ///
  18. /// @tparam DerivedV derived type of eigen matrix for V (e.g. derived from
  19. /// Eigen::MatrixXd)
  20. /// @tparam DerivedF derived type of eigen matrix for F (e.g. derived from
  21. /// Eigen::MatrixXi)
  22. /// @tparam Scalar scalar type for eigen sparse matrix (e.g. double)
  23. /// @param[in] F #F by 3 list of mesh faces (must be triangles)
  24. /// @param[out] A #Vx2 by #Vx2 area matrix
  25. ///
  26. template <typename DerivedF, typename Scalar>
  27. IGL_INLINE void vector_area_matrix(
  28. const Eigen::MatrixBase<DerivedF> & F,
  29. Eigen::SparseMatrix<Scalar>& A);
  30. }
  31. #ifndef IGL_STATIC_LIBRARY
  32. # include "vector_area_matrix.cpp"
  33. #endif
  34. #endif