// This file is part of libigl, a simple c++ geometry processing library. // // Copyright (C) 2017 Oded Stein // // This Source Code Form is subject to the terms of the Mozilla Public License // v. 2.0. If a copy of the MPL was not distributed with this file, You can // obtain one at http://mozilla.org/MPL/2.0/. #include "isolines.h" #include #include #include #include "remove_duplicate_vertices.h" template IGL_INLINE void igl::isolines( const Eigen::MatrixBase& V, const Eigen::MatrixBase& F, const Eigen::MatrixBase& z, const int n, Eigen::PlainObjectBase& isoV, Eigen::PlainObjectBase& isoE) { //Constants const int dim = V.cols(); assert(dim==2 || dim==3); const int nVerts = V.rows(); assert(z.rows() == nVerts && "There must be as many function entries as vertices"); const int nFaces = F.rows(); const int np1 = n+1; const double min = z.minCoeff(), max = z.maxCoeff(); //Following http://www.alecjacobson.com/weblog/?p=2529 typedef typename DerivedZ::Scalar Scalar; typedef Eigen::Matrix Vec; Vec iso(np1); for(int i=0; i Matrix; std::array t{{Matrix(nFaces, np1), Matrix(nFaces, np1), Matrix(nFaces, np1)}}; for(int i=0; i1) t[k](i,j) = std::numeric_limits::quiet_NaN(); } } } std::array,3> Fij, Iij; for(int i=0; i LIVec; typedef Eigen::Matrix LMat; typedef Eigen::Matrix LIMat; LIVec dummy1, dummy2; igl::remove_duplicate_vertices(LMat(isoV), LIMat(isoE), 2.2204e-15, isoV, dummy1, dummy2, isoE); } #ifdef IGL_STATIC_LIBRARY // Explicit template instantiation template void igl::isolines, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, int const, Eigen::PlainObjectBase > &, Eigen::PlainObjectBase > &); #endif