Эх сурвалжийг харах

face_wise option in reorient_facets_raycast

Former-commit-id: 958c361ab82ad01b39ab1cc193a7f34a0abbd576
Kenshi Takayama (kenshi 11 жил өмнө
parent
commit
d03a624155

+ 9 - 2
include/igl/embree/reorient_facets_raycast.cpp

@@ -26,6 +26,7 @@
     const Eigen::PlainObjectBase<DerivedF> & F,
     int rays_total,
     int rays_minimum,
+    bool face_wise,
     bool use_parity,
     bool is_verbose,
     Eigen::PlainObjectBase<DerivedI> & I)
@@ -38,10 +39,16 @@
   // number of faces
   const int m = F.rows();
   
-  if (is_verbose) cout << "extracting patches... ";
   VectorXi C;
   MatrixXi FF = F;
-  bfs_orient(F,FF,C);
+  if (face_wise) {
+    C.resize(m);
+    for (int i = 0; i < m; ++i) C(i) = i;
+  
+  } else {
+    if (is_verbose) cout << "extracting patches... ";
+    bfs_orient(F,FF,C);
+  }
   if (is_verbose) cout << (C.maxCoeff() + 1)  << " components. ";
   
   // number of patches

+ 4 - 2
include/igl/embree/reorient_facets_raycast.h

@@ -19,8 +19,9 @@ namespace igl
   //   F                            #F by 3 list of triangle indices
   //   rays_total                   Total number of rays that will be shot
   //   rays_minimum                 Minimum number of rays that each patch should receive
-  //   use_parity                   Flag for using parity mode
-  //   is_verbose                   Flag for verbose output to cout
+  //   face_wise                    Decision made for each face independently, no use of patches (i.e., each face is treated as a patch)
+  //   use_parity                   Use parity mode
+  //   is_verbose                   Verbose output to cout
   // Outputs:
   //   I                            #F list of whether face has been flipped
   template <
@@ -32,6 +33,7 @@ namespace igl
     const Eigen::PlainObjectBase<DerivedF> & F,
     int rays_total,
     int rays_minimum,
+    bool face_wise,
     bool use_parity,
     bool is_verbose,
     Eigen::PlainObjectBase<DerivedI> & I);