// This file is part of libigl, a simple c++ geometry processing library. // // Copyright (C) 2013 Alec Jacobson // // 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 "false_barycentric_subdivision.h" #include "verbose.h" #include #include template IGL_INLINE void igl::false_barycentric_subdivision( const Eigen::PlainObjectBase & V, const Eigen::PlainObjectBase & F, Eigen::PlainObjectBase & VD, Eigen::PlainObjectBase & FD) { using namespace Eigen; // Compute face barycenter Eigen::MatrixXd BC; igl::barycenter(V,F,BC); // Add the barycenters to the vertices VD.resize(V.rows()+F.rows(),3); VD.block(0,0,V.rows(),3) = V; VD.block(V.rows(),0,F.rows(),3) = BC; // Each face is split four ways FD.resize(F.rows()*3,3); for (unsigned i=0; i, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); template void igl::false_barycentric_subdivision, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); #endif