// This file is part of libigl, a simple c++ geometry processing library. // // Copyright (C) 2020 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 "average_from_edges_onto_vertices.h" template IGL_INLINE void igl::average_from_edges_onto_vertices( const Eigen::MatrixBase &F, const Eigen::MatrixBase &E, const Eigen::MatrixBase &oE, const Eigen::MatrixBase &uE, Eigen::PlainObjectBase &uV) { using Scalar = typename DeriveduE::Scalar; using VecX = Eigen::Matrix; using Int = typename DerivedF::Scalar; assert(E.rows()==F.rows() && "E does not match dimensions of F."); assert(oE.rows()==F.rows() && "oE does not match dimensions of F."); assert(E.cols()==3 && F.cols()==3 && oE.cols()==3 && "This method is for triangle meshes."); const Int n = F.maxCoeff()+1; VecX edgesPerVertex(n); edgesPerVertex.setZero(); uV.resize(n,1); uV.setZero(); for(Eigen::Index i=0; i0) { uV(i) /= valence; } } } #ifdef IGL_STATIC_LIBRARY // Explicit template instantiation // generated by autoexplicit.sh template void igl::average_from_edges_onto_vertices, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); template void igl::average_from_edges_onto_vertices, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); template void igl::average_from_edges_onto_vertices, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); #endif