find_self_intersections.cpp 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2024 Alec Jacobson <[email protected]>
  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. #include "find_intersections.h"
  9. #include "find_self_intersections.h"
  10. template <
  11. typename DerivedV,
  12. typename DerivedF,
  13. typename DerivedIF,
  14. typename DerivedCP>
  15. IGL_INLINE bool igl::predicates::find_self_intersections(
  16. const Eigen::MatrixBase<DerivedV> & V,
  17. const Eigen::MatrixBase<DerivedF> & F,
  18. const bool first_only,
  19. Eigen::PlainObjectBase<DerivedIF> & IF,
  20. Eigen::PlainObjectBase<DerivedCP> & CP)
  21. {
  22. // This is really just a wrapper around fast_find_intersections which will
  23. // internally detect that V,F are the second set
  24. return find_intersections( V,F,V,F,first_only,IF,CP);
  25. }
  26. template <
  27. typename DerivedV,
  28. typename DerivedF,
  29. typename DerivedIF,
  30. typename DerivedCP,
  31. typename DerivedEV,
  32. typename DerivedEE,
  33. typename DerivedEI>
  34. bool igl::predicates::find_self_intersections(
  35. const Eigen::MatrixBase<DerivedV> & V,
  36. const Eigen::MatrixBase<DerivedF> & F,
  37. Eigen::PlainObjectBase<DerivedIF> & IF,
  38. Eigen::PlainObjectBase<DerivedCP> & CP,
  39. Eigen::PlainObjectBase<DerivedEV> & EV,
  40. Eigen::PlainObjectBase<DerivedEE> & EE,
  41. Eigen::PlainObjectBase<DerivedEI> & EI)
  42. {
  43. return find_intersections( V,F,V,F,IF,CP,EV,EE,EI);
  44. }
  45. #ifdef IGL_STATIC_LIBRARY
  46. // Explicit template instantiation
  47. // generated by autoexplicit.sh
  48. template bool igl::predicates::find_self_intersections<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Array<bool, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Array<bool, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
  49. // generated by autoexplicit.sh
  50. template bool igl::predicates::find_self_intersections<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Array<bool, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, bool, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Array<bool, -1, 1, 0, -1, 1> >&);
  51. #endif