edge_lengths.h 1.3 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_EDGE_LENGTHS_H
  9. #define IGL_EDGE_LENGTHS_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Dense>
  12. namespace igl
  13. {
  14. // Constructs a list of lengths of edges opposite each index in a face
  15. // (triangle) list
  16. // Templates:
  17. // DerivedV derived from vertex positions matrix type: i.e. MatrixXd
  18. // DerivedF derived from face indices matrix type: i.e. MatrixXi
  19. // DerivedL derived from edge lengths matrix type: i.e. MatrixXd
  20. // Inputs:
  21. // V eigen matrix #V by 3
  22. // F #F by 3 list of mesh faces (must be triangles)
  23. // Outputs:
  24. // E #E by 2 list of edges in no particular order
  25. //
  26. // See also: adjacency_matrix
  27. template <typename DerivedV, typename DerivedF, typename DerivedL>
  28. IGL_INLINE void edge_lengths(
  29. const Eigen::PlainObjectBase<DerivedV>& V,
  30. const Eigen::PlainObjectBase<DerivedF>& F,
  31. Eigen::PlainObjectBase<DerivedL>& L);
  32. }
  33. #ifdef IGL_HEADER_ONLY
  34. # include "edge_lengths.cpp"
  35. #endif
  36. #endif