avg_edge_length.h 904 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef IGL_AVERAGEEDGELENGTH_H
  2. #define IGL_AVERAGEEDGELENGTH_H
  3. #include "igl/igl_inline.h"
  4. #include <Eigen/Core>
  5. #include <string>
  6. #include <vector>
  7. namespace igl
  8. {
  9. // Compute the average edge length for the given triangle mesh
  10. // Templates:
  11. // DerivedV derived from vertex positions matrix type: i.e. MatrixXd
  12. // DerivedF derived from face indices matrix type: i.e. MatrixXi
  13. // DerivedL derived from edge lengths matrix type: i.e. MatrixXd
  14. // Inputs:
  15. // V eigen matrix #V by 3
  16. // F #F by 3 list of mesh faces (must be triangles)
  17. // Outputs:
  18. // l average edge length
  19. //
  20. // See also: adjacency_matrix
  21. template <typename DerivedV, typename DerivedF>
  22. IGL_INLINE double avg_edge_length(
  23. const Eigen::PlainObjectBase<DerivedV>& V,
  24. const Eigen::PlainObjectBase<DerivedF>& F);
  25. }
  26. //#ifdef IGL_HEADER_ONLY
  27. # include "avg_edge_length.cpp"
  28. //#endif
  29. #endif