outer_vertex.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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_VERTEX_H
  10. #define IGL_COPYLEFT_CGAL_OUTER_VERTEX_H
  11. #include "../../igl_inline.h"
  12. #include <Eigen/Core>
  13. namespace igl
  14. {
  15. namespace copyleft
  16. {
  17. namespace cgal
  18. {
  19. /// Find a vertex that is reachable from infinite without crossing any faces.
  20. /// Such vertex is called "outer vertex."
  21. ///
  22. /// \pre The input mesh must have all self-intersection resolved and
  23. /// no duplicated vertices. See cgal::remesh_self_intersections.h for how to
  24. /// obtain such input.
  25. ///
  26. /// @param[in] V #V by 3 list of vertex positions
  27. /// @param[in] F #F by 3 list of triangle indices into V
  28. /// @param[in] I #I list of facets to consider
  29. /// @param[out] v_index index of outer vertex
  30. /// @param[out] A #A list of facets incident to the outer vertex
  31. template <
  32. typename DerivedV,
  33. typename DerivedF,
  34. typename DerivedI,
  35. typename IndexType,
  36. typename DerivedA
  37. >
  38. IGL_INLINE void outer_vertex(
  39. const Eigen::MatrixBase<DerivedV> & V,
  40. const Eigen::MatrixBase<DerivedF> & F,
  41. const Eigen::MatrixBase<DerivedI> & I,
  42. IndexType & v_index,
  43. Eigen::PlainObjectBase<DerivedA> & A);
  44. }
  45. }
  46. }
  47. #ifndef IGL_STATIC_LIBRARY
  48. # include "outer_vertex.cpp"
  49. #endif
  50. #endif