Pārlūkot izejas kodu

spelling error

Former-commit-id: 089e6fda539eba652c70345f609ccbbdbdec726a
Alec Jacobson 10 gadi atpakaļ
vecāks
revīzija
b5577002f0

+ 4 - 4
include/igl/boolean/mesh_boolean.cpp

@@ -1,5 +1,5 @@
 #include "mesh_boolean.h"
-#include <igl/peal_outer_hull_layers.h>
+#include <igl/peel_outer_hull_layers.h>
 #include <igl/cgal/remesh_self_intersections.h>
 #include <igl/remove_unreferenced.h>
 #include <igl/unique_simplices.h>
@@ -169,13 +169,13 @@ IGL_INLINE void igl::mesh_boolean(
   }
 
 #ifdef IGL_MESH_BOOLEAN_DEBUG
-  cout<<"peal..."<<endl;
+  cout<<"peel..."<<endl;
 #endif
   Matrix<bool,Dynamic,1> from_A(CF.rows());
-  // Peal layers keeping track of odd and even flips
+  // peel layers keeping track of odd and even flips
   Matrix<bool,Dynamic,1> odd;
   Matrix<bool,Dynamic,1> flip;
-  peal_outer_hull_layers(CV,CF,odd,flip);
+  peel_outer_hull_layers(CV,CF,odd,flip);
 
 #ifdef IGL_MESH_BOOLEAN_DEBUG
   cout<<"categorize..."<<endl;

+ 15 - 10
include/igl/peal_outer_hull_layers.cpp → include/igl/peel_outer_hull_layers.cpp

@@ -1,16 +1,19 @@
-#include "peal_outer_hull_layers.h"
+#include "peel_outer_hull_layers.h"
 #include "outer_hull.h"
 #include "writePLY.h"
 #include <vector>
 #include <iostream>
-//#define IGL_PEAL_OUTER_HULL_LAYERS_DEBUG
+#define IGL_PEEL_OUTER_HULL_LAYERS_DEBUG
+#ifdef IGL_PEEL_OUTER_HULL_LAYERS_DEBUG
+#include "STR.h"
+#endif
 
 template <
   typename DerivedV,
   typename DerivedF,
   typename Derivedodd,
   typename Derivedflip>
-IGL_INLINE void igl::peal_outer_hull_layers(
+IGL_INLINE size_t igl::peel_outer_hull_layers(
   const Eigen::PlainObjectBase<DerivedV > & V,
   const Eigen::PlainObjectBase<DerivedF > & F,
   Eigen::PlainObjectBase<Derivedodd > & odd,
@@ -23,11 +26,11 @@ IGL_INLINE void igl::peal_outer_hull_layers(
   typedef Matrix<Index,Dynamic,1> MatrixXI;
   typedef Matrix<typename Derivedflip::Scalar,Dynamic,Derivedflip::ColsAtCompileTime> MatrixXflip;
   const Index m = F.rows();
-#ifdef IGL_PEAL_OUTER_HULL_LAYERS_DEBUG
-  cout<<"peal outer hull layers..."<<endl;
+#ifdef IGL_PEEL_OUTER_HULL_LAYERS_DEBUG
+  cout<<"peel outer hull layers..."<<endl;
 #endif
 
-#ifdef IGL_PEAL_OUTER_HULL_LAYERS_DEBUG
+#ifdef IGL_PEEL_OUTER_HULL_LAYERS_DEBUG
   cout<<"resize output ..."<<endl;
 #endif
   // keep track of iteration parity and whether flipped in hull
@@ -47,12 +50,13 @@ IGL_INLINE void igl::peal_outer_hull_layers(
     MatrixXF Fo;
     MatrixXI Jo;
     MatrixXflip flipr;
-#ifdef IGL_PEAL_OUTER_HULL_LAYERS_DEBUG
+#ifdef IGL_PEEL_OUTER_HULL_LAYERS_DEBUG
   cout<<"calling outer hull..."<<endl;
-  writePLY("outer-hull-input.ply",V,Fr);
+  writePLY(STR("outer-hull-input-"<<iter<<".ply"),V,Fr);
 #endif
     outer_hull(V,Fr,Fo,Jo,flipr);
-#ifdef IGL_PEAL_OUTER_HULL_LAYERS_DEBUG
+#ifdef IGL_PEEL_OUTER_HULL_LAYERS_DEBUG
+  writePLY(STR("outer-hull-output-"<<iter<<".ply"),V,Fo);
   cout<<"reindex, flip..."<<endl;
 #endif
     assert(Fo.rows() == Jo.rows());
@@ -86,10 +90,11 @@ IGL_INLINE void igl::peal_outer_hull_layers(
     odd_iter = !odd_iter;
     iter++;
   }
+  return iter;
 }
 
 
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template specialization
-template void igl::peal_outer_hull_layers<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<bool, -1, 1, 0, -1, 1>, Eigen::Matrix<bool, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<bool, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<bool, -1, 1, 0, -1, 1> >&);
+template size_t igl::peel_outer_hull_layers<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<bool, -1, 1, 0, -1, 1>, Eigen::Matrix<bool, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<bool, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<bool, -1, 1, 0, -1, 1> >&);
 #endif

+ 9 - 8
include/igl/peal_outer_hull_layers.h → include/igl/peel_outer_hull_layers.h

@@ -1,27 +1,28 @@
-#ifndef PEAL_OUTER_HULL_LAYERS_H
-#define PEAL_OUTER_HULL_LAYERS_H
+#ifndef PEEL_OUTER_HULL_LAYERS_H
+#define PEEL_OUTER_HULL_LAYERS_H
 #include "igl_inline.h"
 #include <Eigen/Core>
 namespace igl
 {
   // Computes necessary generic information for boolean operations by
-  // successively "pealing" off the "outer hull" of a mesh (V,F) resulting from
+  // successively "peeling" off the "outer hull" of a mesh (V,F) resulting from
   // "resolving" all (self-)intersections.
   //
   // Inputs:
   //   V  #V by 3 list of vertex positions
   //   F  #F by 3 list of triangle indices into V
   // Outputs:
-  //   odd  #F list of whether facet belongs to an odd iteration peal (otherwise
-  //     an even iteration peal)
+  //   odd  #F list of whether facet belongs to an odd iteration peel (otherwise
+  //     an even iteration peel)
   //   flip  #F list of whether a facet's orientation was flipped when facet
-  //     "pealed" into its associated outer hull layer.
+  //     "peeled" into its associated outer hull layer.
+  // Returns number of peels
   template <
     typename DerivedV,
     typename DerivedF,
     typename Derivedodd,
     typename Derivedflip>
-  IGL_INLINE void peal_outer_hull_layers(
+  IGL_INLINE size_t peel_outer_hull_layers(
     const Eigen::PlainObjectBase<DerivedV > & V,
     const Eigen::PlainObjectBase<DerivedF > & F,
     Eigen::PlainObjectBase<Derivedodd > & odd,
@@ -29,6 +30,6 @@ namespace igl
 }
 
 #ifndef IGL_STATIC_LIBRARY
-#  include "peal_outer_hull_layers.cpp"
+#  include "peel_outer_hull_layers.cpp"
 #endif
 #endif