intersect_other.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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_INTERSECT_OTHER_H
  9. #define IGL_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. // INTERSECT Given a triangle mesh (V,F) and another mesh (U,G) find all pairs
  21. // of intersecting faces. Note that self-intersections are ignored.
  22. //
  23. // [VV,FF,IF] = selfintersect(V,F,'ParameterName',ParameterValue, ...)
  24. //
  25. // Inputs:
  26. // V #V by 3 list of vertex positions
  27. // F #F by 3 list of triangle indices into V
  28. // U #U by 3 list of vertex positions
  29. // G #G by 3 list of triangle indices into U
  30. // first_only whether to only detect the first intersection.
  31. // Outputs:
  32. // IF #intersecting face pairs by 2 list of intersecting face pairs,
  33. // indexing F and G
  34. //
  35. // See also: selfintersect
  36. IGL_INLINE void intersect_other(
  37. const Eigen::MatrixXd & V,
  38. const Eigen::MatrixXi & F,
  39. const Eigen::MatrixXd & U,
  40. const Eigen::MatrixXi & G,
  41. const bool first_only,
  42. Eigen::MatrixXi & IF);
  43. }
  44. #ifdef IGL_HEADER_ONLY
  45. # include "intersect_other.cpp"
  46. #endif
  47. #endif