orient_outward_ao.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #if false
  2. #ifndef IGL_ORIENT_OUTWARD_AO_H
  3. #define IGL_ORIENT_OUTWARD_AO_H
  4. #include "igl_inline.h"
  5. #include <Eigen/Core>
  6. namespace igl
  7. {
  8. // Forward define
  9. template <
  10. typename PointMatrixType,
  11. typename FaceMatrixType,
  12. typename RowVector3>
  13. class EmbreeIntersector;
  14. // Orient each component (identified by C) of a mesh (V,F) so the normals on
  15. // average point away from the patch's centroid.
  16. //
  17. // Inputs:
  18. // V #V by 3 list of vertex positions
  19. // F #F by 3 list of triangle indices
  20. // C #F list of components
  21. // ei EmbreeIntersector containing (V,F)
  22. // num_samples total number of rays to be shot
  23. // Outputs:
  24. // FF #F by 3 list of new triangle indices such that FF(~I,:) = F(~I,:) and
  25. // FF(I,:) = fliplr(F(I,:)) (OK if &FF = &F)
  26. // I max(C)+1 list of whether face has been flipped
  27. template <
  28. typename DerivedV,
  29. typename DerivedF,
  30. typename DerivedC,
  31. typename DerivedFF,
  32. typename DerivedI>
  33. IGL_INLINE void orient_outward_ao(
  34. const Eigen::PlainObjectBase<DerivedV> & V,
  35. const Eigen::PlainObjectBase<DerivedF> & F,
  36. const Eigen::PlainObjectBase<DerivedC> & C,
  37. const igl::EmbreeIntersector<PointMatrixType,FaceMatrixType,RowVector3> & ei,
  38. const int num_samples,
  39. Eigen::PlainObjectBase<DerivedFF> & FF,
  40. Eigen::PlainObjectBase<DerivedI> & I);
  41. };
  42. #ifdef IGL_HEADER_ONLY
  43. # include "orient_outward_ao.cpp"
  44. #endif
  45. #endif
  46. #endif