vector_area_matrix.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2014 Daniele Panozzo <daniele.panozzo@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_AREAMATRIX_H
  9. #define IGL_AREAMATRIX_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. // Templates:
  19. // DerivedV derived type of eigen matrix for V (e.g. derived from
  20. // MatrixXd)
  21. // DerivedF derived type of eigen matrix for F (e.g. derived from
  22. // MatrixXi)
  23. // Scalar scalar type for eigen sparse matrix (e.g. double)
  24. // Inputs:
  25. // F #F by 3 list of mesh faces (must be triangles)
  26. // Outputs:
  27. // A #Vx2 by #Vx2 area matrix
  28. //
  29. template <typename DerivedF, typename Scalar>
  30. IGL_INLINE void vector_area_matrix(
  31. const Eigen::PlainObjectBase<DerivedF> & F,
  32. Eigen::SparseMatrix<Scalar>& A);
  33. }
  34. #ifndef IGL_STATIC_LIBRARY
  35. # include "vector_area_matrix.cpp"
  36. #endif
  37. #endif