// This file is part of libigl, a simple c++ geometry processing library. // // Copyright (C) 2018 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 "tet_tet_adjacency.h" #include "parallel_for.h" #include #include template IGL_INLINE void igl::tet_tet_adjacency( const Eigen::MatrixBase& T, Eigen::PlainObjectBase& TT, Eigen::PlainObjectBase& TTi) { assert(T.cols()==4 && "Tets have four vertices."); //Preprocess using Array = std::array; std::vector TTT(4*T.rows()); const auto loop_f = [&](const int t) { TTT[4*t] = {T(t,0),T(t,1),T(t,2),t,0}; TTT[4*t+1] = {T(t,0),T(t,1),T(t,3),t,1}; TTT[4*t+2] = {T(t,1),T(t,2),T(t,3),t,2}; TTT[4*t+3] = {T(t,2),T(t,0),T(t,3),t,3}; for(int i=0; i<4; ++i) std::sort(TTT[4*t+i].begin(), TTT[4*t+i].begin()+3); }; //for(int t=0; t IGL_INLINE void igl::tet_tet_adjacency( const Eigen::MatrixBase& T, Eigen::PlainObjectBase& TT) { DerivedTT TTi; tet_tet_adjacency(T, TT, TTi); } #ifdef IGL_STATIC_LIBRARY template void igl::tet_tet_adjacency, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); #endif