winding_number.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. // F #F by 3 list of triangle indices, minimum index is 0
  19. // O no by 3 list of origin positions
  20. // Outputs:
  21. // S no by 1 list of winding numbers
  22. //
  23. // 3d
  24. IGL_INLINE void winding_number(
  25. const Eigen::MatrixXd & V,
  26. const Eigen::MatrixXi & F,
  27. const Eigen::MatrixXd & O,
  28. Eigen::VectorXd & W);
  29. // Inputs:
  30. // V pointer to array containing #V by 3 vertex positions along rows,
  31. // given in column major order
  32. // n number of mesh vertices
  33. // F pointer to array containing #F by 3 face indices along rows,
  34. // given in column major order
  35. // m number of faces
  36. // O pointer to array containing #O by 3 query positions along rows,
  37. // given in column major order
  38. // no number of origins
  39. // Outputs:
  40. // S no by 1 list of winding numbers
  41. template <typename DerivedF>
  42. IGL_INLINE void winding_number_3(
  43. const double * V,
  44. const int n,
  45. const DerivedF * F,
  46. const int m,
  47. const double * O,
  48. const int no,
  49. double * S);
  50. //// Only one evaluation origin
  51. //template <typename DerivedF>
  52. //IGL_INLINE void winding_number_3(
  53. // const double * V,
  54. // const int n,
  55. // const DerivedF * F,
  56. // const int m,
  57. // const double * O,
  58. // double * S);
  59. // 2d
  60. template <typename DerivedF>
  61. IGL_INLINE void winding_number_2(
  62. const double * V,
  63. const int n,
  64. const DerivedF * F,
  65. const int m,
  66. const double * O,
  67. const int no,
  68. double * S);
  69. }
  70. #ifndef IGL_STATIC_LIBRARY
  71. # include "winding_number.cpp"
  72. #endif
  73. #endif