is_boundary_edge.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2015 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 IS_BOUNDARY_EDGE_H
  9. #define IS_BOUNDARY_EDGE_H
  10. #include <Eigen/Dense>
  11. namespace igl
  12. {
  13. // IS_BOUNDARY_EDGE 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. // Inputs:
  17. // E #E by 2 list of edges
  18. // F #F by 3 list of triangles
  19. // Outputs:
  20. // B #E list bools. true iff unoriented edge occurs exactly once in F
  21. // (non-manifold and non-existant edges will be false)
  22. //
  23. template <
  24. typename DerivedF,
  25. typename DerivedE,
  26. typename DerivedB>
  27. void is_boundary_edge(
  28. const Eigen::PlainObjectBase<DerivedE> & E,
  29. const Eigen::PlainObjectBase<DerivedF> & F,
  30. Eigen::PlainObjectBase<DerivedB> & B);
  31. // Wrapper where Edges should also be computed from F
  32. // E #E by 2 list of edges
  33. // EMAP #F*3 list of indices mapping allE to E
  34. template <
  35. typename DerivedF,
  36. typename DerivedE,
  37. typename DerivedB,
  38. typename DerivedEMAP>
  39. void is_boundary_edge(
  40. const Eigen::PlainObjectBase<DerivedF> & F,
  41. Eigen::PlainObjectBase<DerivedB> & B,
  42. Eigen::PlainObjectBase<DerivedE> & E,
  43. Eigen::PlainObjectBase<DerivedEMAP> & EMAP);
  44. }
  45. #ifndef IGL_STATIC_LIBRARY
  46. # include "is_boundary_edge.cpp"
  47. #endif
  48. #endif