#include #include "peal_outer_hull_layers.h" #include "outer_hull.h" #include using namespace std; template < typename DerivedV, typename DerivedF, typename Derivedodd, typename Derivedflip> IGL_INLINE void igl::peal_outer_hull_layers( const Eigen::PlainObjectBase & V, const Eigen::PlainObjectBase & F, Eigen::PlainObjectBase & odd, Eigen::PlainObjectBase & flip) { using namespace Eigen; using namespace std; typedef typename DerivedF::Index Index; typedef Matrix MatrixXF; typedef Matrix MatrixXI; typedef Matrix MatrixXflip; const Index m = F.rows(); // keep track of iteration parity and whether flipped in hull MatrixXF Fr = F; odd.resize(m,1); flip.resize(m,1); // Keep track of index map MatrixXI IM = MatrixXI::LinSpaced(m,0,m-1); // This is O(n * layers) bool odd_iter = true; MatrixXI P(m,1); Index iter = 0; while(Fr.size() > 0) { assert(Fr.rows() == IM.rows()); // Compute outer hull of current Fr MatrixXF Fo; MatrixXI Jo; MatrixXflip flipr; outer_hull(V,Fr,Fo,Jo,flipr); assert(Fo.rows() == Jo.rows()); // all faces in Fo of Fr vector in_outer(Fr.rows(),false); for(Index g = 0;g, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); #endif