outer_edge.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2015 Qingan Zhou <[email protected]>
  4. // Copyright (C) 2021 Alec Jacobson <[email protected]>
  5. //
  6. // This Source Code Form is subject to the terms of the Mozilla Public License
  7. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  8. // obtain one at http://mozilla.org/MPL/2.0/.
  9. #ifndef IGL_COPYLEFT_CGAL_OUTER_EDGE_H
  10. #define IGL_COPYLEFT_CGAL_OUTER_EDGE_H
  11. #include "../../igl_inline.h"
  12. #include <Eigen/Core>
  13. namespace igl
  14. {
  15. namespace copyleft
  16. {
  17. namespace cgal
  18. {
  19. /// Find an edge that is reachable from infinity without crossing any faces.
  20. /// Such edge is called "outer edge."
  21. ///
  22. /// \pre The input mesh must have all self-intersection resolved
  23. /// and no duplicated vertices. The correctness of the output depends on
  24. /// the fact that there is no edge overlap. See
  25. /// cgal::remesh_self_intersections.h for how to obtain such input.
  26. ///
  27. /// @param[in] V #V by 3 list of vertex positions
  28. /// @param[in] F #F by 3 list of triangle indices into V
  29. /// @param[in] I #I list of facets to consider
  30. /// @param[out] v1 index of the first end point of outer edge
  31. /// @param[out] v2 index of the second end point of outer edge
  32. /// @param[out] A #A list of facets incident to the outer edge
  33. template<
  34. typename DerivedV,
  35. typename DerivedF,
  36. typename DerivedI,
  37. typename IndexType,
  38. typename DerivedA
  39. >
  40. IGL_INLINE void outer_edge(
  41. const Eigen::MatrixBase<DerivedV> & V,
  42. const Eigen::MatrixBase<DerivedF> & F,
  43. const Eigen::MatrixBase<DerivedI> & I,
  44. IndexType & v1,
  45. IndexType & v2,
  46. Eigen::PlainObjectBase<DerivedA> & A);
  47. }
  48. }
  49. }
  50. #ifndef IGL_STATIC_LIBRARY
  51. # include "outer_edge.cpp"
  52. #endif
  53. #endif