fast_find_self_intersections.h 1.8 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. {
  15. /// Identify triangles where two meshes interesect
  16. /// using AABBTree and tri_tri_intersection_test_3d.
  17. ///
  18. /// @param[in] V #V by 3 list representing vertices on the first mesh
  19. /// @param[in] F #F by 3 list representing triangles on the first mesh
  20. /// @param[out] IF #IF by 2 list of intersecting triangle pairs, so that
  21. /// F1(IF(i,0),:) intersects F2(IF(i,1),:)
  22. /// @param[out] EV #EV by 3 list of vertices definining intersection segments
  23. /// for non-coplanar intersections
  24. /// @param[out] EE #EE by 2 list of edges indices into rows of EV
  25. /// @param[out] EI #EI by 1 list of indices into rows IF indicating source of
  26. /// intersection.
  27. ///
  28. /// \see copyleft::cgal::SelfIntersectMesh
  29. template <
  30. typename DerivedV,
  31. typename DerivedF,
  32. typename DerivedIF,
  33. typename DerivedEV,
  34. typename DerivedEE,
  35. typename DerivedEI>
  36. IGL_INLINE bool fast_find_self_intersections(
  37. const Eigen::MatrixBase<DerivedV> & V,
  38. const Eigen::MatrixBase<DerivedF> & F,
  39. const bool detect_only,
  40. const bool first_only,
  41. Eigen::PlainObjectBase<DerivedIF> & IF,
  42. Eigen::PlainObjectBase<DerivedEV> & EV,
  43. Eigen::PlainObjectBase<DerivedEE> & EE,
  44. Eigen::PlainObjectBase<DerivedEI> & EI);
  45. };
  46. #ifndef IGL_STATIC_LIBRARY
  47. # include "fast_find_self_intersections.cpp"
  48. #endif
  49. #endif