intersect_other.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef IGL_INTERSECT_OTHER_H
  2. #define IGL_INTERSECT_OTHER_H
  3. #include <igl/igl_inline.h>
  4. #include <Eigen/Dense>
  5. #ifdef MEX
  6. # include <mex.h>
  7. # include <cassert>
  8. # undef assert
  9. # define assert( isOK ) ( (isOK) ? (void)0 : (void) mexErrMsgTxt(C_STR(__FILE__<<":"<<__LINE__<<": failed assertion `"<<#isOK<<"'"<<std::endl) ) )
  10. #endif
  11. namespace igl
  12. {
  13. // INTERSECT Given a triangle mesh (V,F) and another mesh (U,G) find all pairs
  14. // of intersecting faces. Note that self-intersections are ignored.
  15. //
  16. // [VV,FF,IF] = selfintersect(V,F,'ParameterName',ParameterValue, ...)
  17. //
  18. // Inputs:
  19. // V #V by 3 list of vertex positions
  20. // F #F by 3 list of triangle indices into V
  21. // U #U by 3 list of vertex positions
  22. // G #G by 3 list of triangle indices into U
  23. // first_only whether to only detect the first intersection.
  24. // Outputs:
  25. // IF #intersecting face pairs by 2 list of intersecting face pairs,
  26. // indexing F and G
  27. //
  28. // See also: selfintersect
  29. IGL_INLINE void intersect_other(
  30. const Eigen::MatrixXd & V,
  31. const Eigen::MatrixXi & F,
  32. const Eigen::MatrixXd & U,
  33. const Eigen::MatrixXi & G,
  34. const bool first_only,
  35. Eigen::MatrixXi & IF);
  36. }
  37. #ifdef IGL_HEADER_ONLY
  38. # include "intersect_other.cpp"
  39. #endif
  40. #endif