intersect_other.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
  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. #ifndef IGL_CGAL_INTERSECT_OTHER_H
  9. #define IGL_CGAL_INTERSECT_OTHER_H
  10. #include <igl/igl_inline.h>
  11. #include <Eigen/Dense>
  12. #ifdef MEX
  13. # include <mex.h>
  14. # include <cassert>
  15. # undef assert
  16. # define assert( isOK ) ( (isOK) ? (void)0 : (void) mexErrMsgTxt(C_STR(__FILE__<<":"<<__LINE__<<": failed assertion `"<<#isOK<<"'"<<std::endl) ) )
  17. #endif
  18. namespace igl
  19. {
  20. namespace cgal
  21. {
  22. // INTERSECT Given a triangle mesh (V,F) and another mesh (U,G) find all pairs
  23. // of intersecting faces. Note that self-intersections are ignored.
  24. //
  25. // [VV,FF,IF] = selfintersect(V,F,'ParameterName',ParameterValue, ...)
  26. //
  27. // Inputs:
  28. // V #V by 3 list of vertex positions
  29. // F #F by 3 list of triangle indices into V
  30. // U #U by 3 list of vertex positions
  31. // G #G by 3 list of triangle indices into U
  32. // first_only whether to only detect the first intersection.
  33. // Outputs:
  34. // IF #intersecting face pairs by 2 list of intersecting face pairs,
  35. // indexing F and G
  36. //
  37. // See also: selfintersect
  38. IGL_INLINE void intersect_other(
  39. const Eigen::MatrixXd & V,
  40. const Eigen::MatrixXi & F,
  41. const Eigen::MatrixXd & U,
  42. const Eigen::MatrixXi & G,
  43. const bool first_only,
  44. Eigen::MatrixXi & IF);
  45. }
  46. }
  47. #ifndef IGL_STATIC_LIBRARY
  48. # include "intersect_other.cpp"
  49. #endif
  50. #endif