winding_number.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #ifndef IGL_WINDING_NUMBER_H
  2. #define IGL_WINDING_NUMBER_H
  3. #include "igl_inline.h"
  4. #include <Eigen/Core>
  5. // Minimum number of iterms per openmp thread
  6. #ifndef IGL_WINDING_NUMBER_OMP_MIN_VALUE
  7. # define IGL_WINDING_NUMBER_OMP_MIN_VALUE 1000
  8. #endif
  9. namespace igl
  10. {
  11. // WINDING_NUMBER Compute the sum of solid angles of a triangle/tetrahedron
  12. // described by points (vectors) V
  13. //
  14. // Templates:
  15. // dim dimension of input
  16. // Inputs:
  17. // V n by 3 list of vertex positions
  18. // n number of mesh vertices
  19. // F #F by 3 list of triangle indices, minimum index is 0
  20. // m number of faces
  21. // O no by 3 list of origin positions
  22. // no number of origins
  23. // Outputs:
  24. // S no by 1 list of winding numbers
  25. //
  26. // 3d
  27. IGL_INLINE void winding_number(
  28. const Eigen::MatrixXd & V,
  29. const Eigen::MatrixXi & F,
  30. const Eigen::MatrixXd & O,
  31. Eigen::VectorXd & W);
  32. template <typename DerivedF>
  33. IGL_INLINE void winding_number_3(
  34. const double * V,
  35. const int n,
  36. const DerivedF * F,
  37. const int m,
  38. const double * O,
  39. const int no,
  40. double * S);
  41. // Only one evaluation origin
  42. template <typename DerivedF>
  43. IGL_INLINE void winding_number_3(
  44. const double * V,
  45. const int n,
  46. const DerivedF * F,
  47. const int m,
  48. const double * O,
  49. double * S);
  50. // 2d
  51. template <typename DerivedF>
  52. IGL_INLINE void winding_number_2(
  53. const double * V,
  54. const int n,
  55. const DerivedF * F,
  56. const int m,
  57. const double * O,
  58. const int no,
  59. double * S);
  60. }
  61. #ifdef IGL_HEADER_ONLY
  62. # include "winding_number.h"
  63. #endif
  64. #endif