is_inside.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef IS_INSIDE
  2. #define IS_INSIDE
  3. #include "../igl_inline.h"
  4. #include <Eigen/Core>
  5. namespace igl {
  6. namespace cgal {
  7. // Determine if mesh (V1, F1) is inside of mesh (V2, F2).
  8. //
  9. // Precondition:
  10. // Both mesh must represent closed, self-intersection free,
  11. // non-degenerated surfaces that
  12. // are the boundary of 3D volumes. In addition, (V1, F1) must not
  13. // intersect with (V2, F2).
  14. //
  15. // Inputs:
  16. // V1 #V1 by 3 list of vertex position of mesh 1
  17. // F1 #F1 by 3 list of triangles indices into V1
  18. // I1 #I1 list of indices into F1, faces to consider.
  19. // V2 #V2 by 3 list of vertex position of mesh 2
  20. // F2 #F2 by 3 list of triangles indices into V2
  21. // I2 #I2 list of indices into F2, faces to consider.
  22. //
  23. // Outputs:
  24. // return true iff (V1, F1) is entirely inside of (V2, F2).
  25. template<typename DerivedV, typename DerivedF, typename DerivedI>
  26. IGL_INLINE bool is_inside(
  27. const Eigen::PlainObjectBase<DerivedV>& V1,
  28. const Eigen::PlainObjectBase<DerivedF>& F1,
  29. const Eigen::PlainObjectBase<DerivedI>& I1,
  30. const Eigen::PlainObjectBase<DerivedV>& V2,
  31. const Eigen::PlainObjectBase<DerivedF>& F2,
  32. const Eigen::PlainObjectBase<DerivedI>& I2);
  33. template<typename DerivedV, typename DerivedF>
  34. IGL_INLINE bool is_inside(
  35. const Eigen::PlainObjectBase<DerivedV>& V1,
  36. const Eigen::PlainObjectBase<DerivedF>& F1,
  37. const Eigen::PlainObjectBase<DerivedV>& V2,
  38. const Eigen::PlainObjectBase<DerivedF>& F2);
  39. }
  40. }
  41. #ifndef IGL_STATIC_LIBRARY
  42. #include "is_inside.cpp"
  43. #endif
  44. #endif