closest_facet.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2015 Qingnan Zhou <qnzhou@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. //
  9. #ifndef IGL_COPYLET_CGAL_CLOSEST_FACET_H
  10. #define IGL_COPYLET_CGAL_CLOSEST_FACET_H
  11. #include "../../igl_inline.h"
  12. #include <Eigen/Core>
  13. namespace igl
  14. {
  15. namespace copyleft
  16. {
  17. namespace cgal
  18. {
  19. // Determine the closest facet for each of the input points.
  20. //
  21. // Inputs:
  22. // V #V by 3 array of vertices.
  23. // F #F by 3 array of faces.
  24. // I #I list of triangle indices to consider.
  25. // P #P by 3 array of query points.
  26. //
  27. // Outputs:
  28. // R #P list of closest facet indices.
  29. // S #P list of bools indicating on which side of the closest facet
  30. // each query point lies.
  31. template<
  32. typename DerivedV,
  33. typename DerivedF,
  34. typename DerivedI,
  35. typename DerivedP,
  36. typename DerivedR,
  37. typename DerivedS >
  38. IGL_INLINE void closest_facet(
  39. const Eigen::PlainObjectBase<DerivedV>& V,
  40. const Eigen::PlainObjectBase<DerivedF>& F,
  41. const Eigen::PlainObjectBase<DerivedI>& I,
  42. const Eigen::PlainObjectBase<DerivedP>& P,
  43. Eigen::PlainObjectBase<DerivedR>& R,
  44. Eigen::PlainObjectBase<DerivedS>& S);
  45. template<
  46. typename DerivedV,
  47. typename DerivedF,
  48. typename DerivedP,
  49. typename DerivedR,
  50. typename DerivedS >
  51. IGL_INLINE void closest_facet(
  52. const Eigen::PlainObjectBase<DerivedV>& V,
  53. const Eigen::PlainObjectBase<DerivedF>& F,
  54. const Eigen::PlainObjectBase<DerivedP>& P,
  55. Eigen::PlainObjectBase<DerivedR>& R,
  56. Eigen::PlainObjectBase<DerivedS>& S);
  57. }
  58. }
  59. }
  60. #ifndef IGL_STATIC_LIBRARY
  61. #include "closest_facet.cpp"
  62. #endif
  63. #endif