triangle_triangle_intersect_shared_vertex.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef IGL_TRIANGLE_TRIANGLE_INTERSECT_SHARED_VERTEX_H
  2. #define IGL_TRIANGLE_TRIANGLE_INTERSECT_SHARED_VERTEX_H
  3. #include "igl_inline.h"
  4. #include <Eigen/Core>
  5. namespace igl
  6. {
  7. /// Determine whether two triangles --- which share a vertex F(f,sf) ==
  8. /// F(g,sg) --- intersect. We consider the `f`th and `g`th triangles in `F`
  9. /// indexing rows of `V` for 3D positions, but the `c`th corner (opposite the
  10. /// shared edge) of the `f`th triangle is replaced by `p`.
  11. ///
  12. /// @param[in] V #V by 3 list of vertex positions
  13. /// @param[in] F #F by 3 list of triangle indices into rows of V
  14. /// @param[in] f index into F of first triangle
  15. /// @param[in] sf corner index of shared vertex in first triangle
  16. /// @param[in] c index into F of corner opposite shared edge (assumed c≠sf)
  17. /// @param[in] p 3D position to replace cth corner of first triangle
  18. /// @param[in] g index into F of second triangle
  19. /// @param[in] sg corner index of shared vertex in second triangle
  20. /// @param[in] epsilon tolerance used to determine intersection
  21. /// @returns true if triangles intersect
  22. ///
  23. /// \see edge_flaps, tri_tri_intersect, triangle_triangle_intersect,
  24. /// triangle_triangle_intersect_shared_edge
  25. ///
  26. /// \pre both faces are assumed to have non-trivial area
  27. template <
  28. typename DerivedV,
  29. typename DerivedF,
  30. typename Derivedp>
  31. IGL_INLINE bool triangle_triangle_intersect_shared_vertex(
  32. const Eigen::MatrixBase<DerivedV> & V,
  33. const Eigen::MatrixBase<DerivedF> & F,
  34. const int f,
  35. const int sf,
  36. const int c,
  37. const Eigen::MatrixBase<Derivedp> & p,
  38. const int g,
  39. const int sg,
  40. const typename DerivedV::Scalar epsilon);
  41. }
  42. #ifndef IGL_STATIC_LIBRARY
  43. # include "triangle_triangle_intersect_shared_vertex.cpp"
  44. #endif
  45. #endif