fast_find_self_intersections.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2022 Vladimir S. FONOV <[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. #pragma once
  9. #ifndef FAST_FIND_SELF_INTERSECTIONS_H
  10. #define FAST_FIND_SELF_INTERSECTIONS_H
  11. #include "igl_inline.h"
  12. #include <Eigen/Core>
  13. namespace igl {
  14. /// Identify triangles where mesh intersects itself
  15. /// using AABBTree and tri_tri_intersection_test_3d
  16. ///
  17. /// @param[in] V #V by 3 list representing vertices
  18. /// @param[in] F #F by 3 list representing triangles.
  19. /// @param[out] intersect #F by 1 indicator that triangle intersects anothe triangle
  20. /// @param[out] edges list of pairs of intersection edges
  21. /// @return whether any self-interections were found
  22. ///
  23. /// \see copyleft::cgal::remesh_self_intersections
  24. template <
  25. typename DerivedV,
  26. typename DerivedF,
  27. typename DerivedI,
  28. typename DerivedE>
  29. IGL_INLINE bool fast_find_self_intersections(
  30. const Eigen::MatrixBase<DerivedV>& V,
  31. const Eigen::MatrixBase<DerivedF>& F,
  32. Eigen::PlainObjectBase<DerivedI>& intersect,
  33. Eigen::PlainObjectBase<DerivedE>& edges );
  34. /// \overload
  35. template <
  36. typename DerivedV,
  37. typename DerivedF,
  38. typename DerivedI>
  39. IGL_INLINE bool fast_find_self_intersections(
  40. const Eigen::MatrixBase<DerivedV>& V,
  41. const Eigen::MatrixBase<DerivedF>& F,
  42. Eigen::PlainObjectBase<DerivedI>& intersect);
  43. };
  44. #ifndef IGL_STATIC_LIBRARY
  45. # include "fast_find_self_intersections.cpp"
  46. #endif
  47. #endif