// This file is part of libigl, a simple c++ geometry processing library. // // Copyright (C) 2020 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 "exploded_view.h" #include "barycenter.h" #include "volume.h" template < typename DerivedV, typename DerivedT, typename DerivedEV, typename DerivedEF, typename DerivedI, typename DerivedJ> IGL_INLINE void igl::exploded_view( const Eigen::MatrixBase & V, const Eigen::MatrixBase & T, const typename DerivedV::Scalar s, const typename DerivedV::Scalar t, Eigen::PlainObjectBase & EV, Eigen::PlainObjectBase & EF, Eigen::PlainObjectBase & I, Eigen::PlainObjectBase & J) { assert(T.cols() == 4 && "T should be a tet mesh"); EV.resize(4*T.rows(),3); EF.resize(4*T.rows(),3); I.resize(EV.rows()); J.resize(EF.rows()); Eigen::MatrixXd BC; igl::barycenter(V,T,BC); Eigen::VectorXd vol; igl::volume(V,T,vol); const Eigen::RowVectorXd c = vol.transpose()*BC/vol.array().sum(); for(int i = 0;i, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::Matrix::Scalar, Eigen::Matrix::Scalar, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); #endif