fast_winding_number.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #ifndef IGL_COPYLEFT_CGAL_FAST_WINDING_NUMBER
  2. #define IGL_COPYLEFT_CGAL_FAST_WINDING_NUMBER
  3. #include "../../igl_inline.h"
  4. #include <Eigen/Core>
  5. #include <vector>
  6. namespace igl
  7. {
  8. namespace copyleft
  9. {
  10. namespace cgal
  11. {
  12. /// Evaluate the fast winding number for point data, without known areas. The
  13. /// areas are calculated using igl::knn and igl::copyleft::cgal::point_areas.
  14. ///
  15. /// This function performes the precomputation and evaluation all in one.
  16. /// If you need to acess the precomuptation for repeated evaluations, use the
  17. /// two functions designed for exposed precomputation, which are the first two
  18. /// functions see in igl/fast_winding_number.h
  19. ///
  20. /// @param[in] P #P by 3 list of point locations
  21. /// @param[in] N #P by 3 list of point normals
  22. /// @param[in] Q #Q by 3 list of query points for the winding number
  23. /// @param[in] expansion_order the order of the taylor expansion. We support 0,1,2.
  24. /// @param[in] beta This is a Barnes-Hut style accuracy term that separates near feild
  25. /// from far field. The higher the beta, the more accurate and slower
  26. /// the evaluation. We reccommend using a beta value of 2.
  27. /// @param[out] WN #Q by 1 list of windinng number values at each query point
  28. ///
  29. template <
  30. typename DerivedP,
  31. typename DerivedN,
  32. typename DerivedQ,
  33. typename BetaType,
  34. typename DerivedWN>
  35. IGL_INLINE void fast_winding_number(
  36. const Eigen::MatrixBase<DerivedP>& P,
  37. const Eigen::MatrixBase<DerivedN>& N,
  38. const Eigen::MatrixBase<DerivedQ>& Q,
  39. const int expansion_order,
  40. const BetaType beta,
  41. Eigen::PlainObjectBase<DerivedWN>& WN);
  42. /// \overload
  43. template <
  44. typename DerivedP,
  45. typename DerivedN,
  46. typename DerivedQ,
  47. typename DerivedWN>
  48. IGL_INLINE void fast_winding_number(
  49. const Eigen::MatrixBase<DerivedP>& P,
  50. const Eigen::MatrixBase<DerivedN>& N,
  51. const Eigen::MatrixBase<DerivedQ>& Q,
  52. Eigen::PlainObjectBase<DerivedWN>& WN);
  53. }
  54. }
  55. }
  56. #ifndef IGL_STATIC_LIBRARY
  57. # include "fast_winding_number.cpp"
  58. #endif
  59. #endif