// This file is part of libigl, a simple c++ geometry processing library. // // Copyright (C) 2014 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 "cdt.h" #include "../../bounding_box.h" #include "tetrahedralize.h" template < typename DerivedV, typename DerivedF, typename DerivedTV, typename DerivedTT, typename DerivedTF> IGL_INLINE bool igl::copyleft::tetgen::cdt( const Eigen::PlainObjectBase& V, const Eigen::PlainObjectBase& F, const CDTParam & param, Eigen::PlainObjectBase& TV, Eigen::PlainObjectBase& TT, Eigen::PlainObjectBase& TF) { using namespace Eigen; using namespace std; // Effective input mesh DerivedV U; DerivedF G; if(param.use_bounding_box) { // Construct bounding box mesh DerivedV BV; DerivedF BF; bounding_box(V,BV,BF); // scale bounding box const RowVector3d mid = (BV.colwise().minCoeff() + BV.colwise().maxCoeff()).eval()*0.5; BV.rowwise() -= mid; assert(param.bounding_box_scale >= 1.); BV.array() *= param.bounding_box_scale; BV.rowwise() += mid; // Append bounding box to mesh U.resize(V.rows()+BV.rows(),V.cols()); U<, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, igl::copyleft::tetgen::CDTParam const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); #endif