triangle_triangle_intersect_shared_edge.h 1.5 KB

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