avg_edge_length.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <alecjacobson@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_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. // Templates:
  18. // DerivedV derived from vertex positions matrix type: i.e. MatrixXd
  19. // DerivedF derived from face indices matrix type: i.e. MatrixXi
  20. // DerivedL derived from edge lengths matrix type: i.e. MatrixXd
  21. // Inputs:
  22. // V eigen matrix #V by 3
  23. // F #F by simplex-size list of mesh faces (must be simplex)
  24. // Outputs:
  25. // l average edge length
  26. //
  27. // See also: adjacency_matrix
  28. template <typename DerivedV, typename DerivedF>
  29. IGL_INLINE double avg_edge_length(
  30. const Eigen::MatrixBase<DerivedV>& V,
  31. const Eigen::MatrixBase<DerivedF>& F);
  32. }
  33. #ifndef IGL_STATIC_LIBRARY
  34. # include "avg_edge_length.cpp"
  35. #endif
  36. #endif