closest_facet.h 2.1 KB

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