#include "offset_surface.h" #include "marching_cubes.h" #include "voxel_grid.h" #include "signed_distance.h" #include "flood_fill.h" #include template < typename DerivedV, typename DerivedF, typename isolevelType, typename DerivedSV, typename DerivedSF, typename DerivedGV, typename Derivedside, typename DerivedS> void igl::offset_surface( const Eigen::MatrixBase & V, const Eigen::MatrixBase & F, const isolevelType isolevel, const typename Derivedside::Scalar s, const SignedDistanceType & signed_distance_type, Eigen::PlainObjectBase & SV, Eigen::PlainObjectBase & SF, Eigen::PlainObjectBase & GV, Eigen::PlainObjectBase & side, Eigen::PlainObjectBase & S) { typedef typename DerivedV::Scalar Scalar; typedef typename DerivedF::Scalar Index; igl::voxel_grid(V,isolevel,s,1,GV,side); const Scalar h = (GV.col(0).maxCoeff()-GV.col(0).minCoeff())/((Scalar)(side(0)-1)); const Scalar lower_bound = isolevel-sqrt(3.0)*h; const Scalar upper_bound = isolevel+sqrt(3.0)*h; { Eigen::Matrix I; Eigen::Matrix C,N; igl::signed_distance( GV,V,F,signed_distance_type,lower_bound,upper_bound,S,I,C,N); } igl::flood_fill(side,S); DerivedS SS = S.array()-isolevel; igl::marching_cubes(SS,GV,side(0),side(1),side(2),0,SV,SF); } #ifdef IGL_STATIC_LIBRARY // Explicit template instantiation // generated by autoexplicit.sh template void igl::offset_surface, Eigen::Matrix, int, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, int, Eigen::Matrix::Scalar, igl::SignedDistanceType const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); // generated by autoexplicit.sh template void igl::offset_surface, Eigen::Matrix, double, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, double, Eigen::Matrix::Scalar, igl::SignedDistanceType const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); template void igl::offset_surface, Eigen::Matrix, float, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, float, Eigen::Matrix::Scalar, igl::SignedDistanceType const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); template void igl::offset_surface, Eigen::Matrix, double, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, double, Eigen::Matrix::Scalar, igl::SignedDistanceType const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); #endif