edge_midpoints.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2020 Oded Stein <[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_EDGE_MIDPOINTS_H
  9. #define IGL_EDGE_MIDPOINTS_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Dense>
  12. namespace igl
  13. {
  14. /// Computes the midpoints of edges in a triangle mesh.
  15. ///
  16. /// @param[in] V #V by 3 list of vertex positions
  17. /// @param[in] F #F by 3 list of triangle indices
  18. /// @param[in] E #F by 3 a mapping from each halfedge to each edge
  19. /// @param[in] oE #F by 3 the orientation (e.g., -1 or 1) of each halfedge
  20. /// compared to the orientation of the actual edge, as computed with
  21. /// orient_halfedges. will be computed if not provided.
  22. /// @param[out] mps |HE| list of edge midpoints
  23. ///
  24. /// \see orient_halfedges
  25. template<typename DerivedV,typename DerivedF,typename DerivedE,
  26. typename DerivedoE, typename Derivedmps>
  27. IGL_INLINE void edge_midpoints(
  28. const Eigen::MatrixBase<DerivedV> &V,
  29. const Eigen::MatrixBase<DerivedF> &F,
  30. const Eigen::MatrixBase<DerivedE> &E,
  31. const Eigen::MatrixBase<DerivedoE> &oE,
  32. Eigen::PlainObjectBase<Derivedmps> &mps);
  33. }
  34. #ifndef IGL_STATIC_LIBRARY
  35. # include "edge_midpoints.cpp"
  36. #endif
  37. #endif