avg_edge_length.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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_AVERAGEEDGELENGTH_H
  9. #define IGL_AVERAGEEDGELENGTH_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. #include <string>
  13. #include <vector>
  14. namespace igl
  15. {
  16. /// Compute the average edge length for the given triangle mesh
  17. ///
  18. /// @tparam DerivedV derived from vertex positions matrix type: i.e. Eigen::MatrixXd
  19. /// @tparam DerivedF derived from face indices matrix type: i.e. Eigen::MatrixXi
  20. /// @tparam DerivedL derived from edge lengths matrix type: i.e. Eigen::MatrixXd
  21. /// @param[in] V #V by dim list of mesh vertex positions
  22. /// @param[in] F #F by simplex-size list of mesh faces (must be simplex)
  23. /// @return average edge length
  24. ///
  25. /// \see adjacency_matrix
  26. template <typename DerivedV, typename DerivedF>
  27. IGL_INLINE double avg_edge_length(
  28. const Eigen::MatrixBase<DerivedV>& V,
  29. const Eigen::MatrixBase<DerivedF>& F);
  30. }
  31. #ifndef IGL_STATIC_LIBRARY
  32. # include "avg_edge_length.cpp"
  33. #endif
  34. #endif