is_boundary_edge.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2015 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 IS_BOUNDARY_EDGE_H
  9. #define IS_BOUNDARY_EDGE_H
  10. #include <Eigen/Dense>
  11. namespace igl
  12. {
  13. /// Determine for each edge E if it is a "boundary edge" in F.
  14. /// Boundary edges are undirected edges which occur only once.
  15. ///
  16. /// @param[in] E #E by 2 list of edges
  17. /// @param[in] F #F by 3 list of triangles
  18. /// @param[out] B #E list bools. true iff unoriented edge occurs exactly once in F
  19. /// (non-manifold and non-existant edges will be false)
  20. template <
  21. typename DerivedF,
  22. typename DerivedE,
  23. typename DerivedB>
  24. void is_boundary_edge(
  25. const Eigen::MatrixBase<DerivedE> & E,
  26. const Eigen::MatrixBase<DerivedF> & F,
  27. Eigen::PlainObjectBase<DerivedB> & B);
  28. /// \overload
  29. ///
  30. /// @param[out] E #E by 2 list of edges
  31. /// @param[out] EMAP #F*3 list of indices mapping allE to E
  32. template <
  33. typename DerivedF,
  34. typename DerivedE,
  35. typename DerivedB,
  36. typename DerivedEMAP>
  37. void is_boundary_edge(
  38. const Eigen::MatrixBase<DerivedF> & F,
  39. Eigen::PlainObjectBase<DerivedB> & B,
  40. Eigen::PlainObjectBase<DerivedE> & E,
  41. Eigen::PlainObjectBase<DerivedEMAP> & EMAP);
  42. }
  43. #ifndef IGL_STATIC_LIBRARY
  44. # include "is_boundary_edge.cpp"
  45. #endif
  46. #endif