reorient_facets_raycast.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <alecjacobson@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. #ifndef IGL_REORIENT_FACETS_RAYCAST_H
  9. #define IGL_REORIENT_FACETS_RAYCAST_H
  10. #include "../igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. // Orient each component (identified by C) of a mesh (V,F) using ambient
  15. // occlusion such that the front side is less occluded than back side
  16. //
  17. // Inputs:
  18. // V #V by 3 list of vertex positions
  19. // F #F by 3 list of triangle indices
  20. // rays_total Total number of rays that will be shot
  21. // rays_minimum Minimum number of rays that each patch should receive
  22. // facet_wise Decision made for each face independently, no use of patches
  23. // (i.e., each face is treated as a patch)
  24. // use_parity Use parity mode
  25. // is_verbose Verbose output to cout
  26. // Outputs:
  27. // I #F list of whether face has been flipped
  28. // C #F list of patch ID (outpute of bfs_orient
  29. // > manifold patches
  30. template <
  31. typename DerivedV,
  32. typename DerivedF,
  33. typename DerivedI,
  34. typename DerivedC>
  35. IGL_INLINE void reorient_facets_raycast(
  36. const Eigen::PlainObjectBase<DerivedV> & V,
  37. const Eigen::PlainObjectBase<DerivedF> & F,
  38. int rays_total,
  39. int rays_minimum,
  40. bool facet_wise,
  41. bool use_parity,
  42. bool is_verbose,
  43. Eigen::PlainObjectBase<DerivedI> & I,
  44. Eigen::PlainObjectBase<DerivedC> & C);
  45. // Outputs:
  46. // FF #F by 3 list of reoriented faces
  47. // Defaults:
  48. // rays_total = F.rows()*100;
  49. // rays_minimum = 10;
  50. // facet_wise = false;
  51. // use_parity = false;
  52. // is_verbose = false;
  53. template <
  54. typename DerivedV,
  55. typename DerivedF,
  56. typename DerivedFF,
  57. typename DerivedI>
  58. IGL_INLINE void reorient_facets_raycast(
  59. const Eigen::PlainObjectBase<DerivedV> & V,
  60. const Eigen::PlainObjectBase<DerivedF> & F,
  61. Eigen::PlainObjectBase<DerivedFF> & FF,
  62. Eigen::PlainObjectBase<DerivedI> & I);
  63. };
  64. #ifndef IGL_STATIC_LIBRARY
  65. # include "reorient_facets_raycast.cpp"
  66. #endif
  67. #endif