// 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 "face_areas.h" #include "edge_lengths.h" #include "doublearea.h" template IGL_INLINE void igl::face_areas( const Eigen::MatrixBase& V, const Eigen::MatrixBase& T, Eigen::PlainObjectBase& A) { assert(T.cols() == 4); DerivedA L; edge_lengths(V,T,L); return face_areas(L,A); } template IGL_INLINE void igl::face_areas( const Eigen::MatrixBase& L, Eigen::PlainObjectBase& A) { return face_areas( L,std::numeric_limits::quiet_NaN(),A); } template IGL_INLINE void igl::face_areas( const Eigen::MatrixBase& L, const typename DerivedL::Scalar doublearea_nan_replacement, Eigen::PlainObjectBase& A) { using namespace Eigen; assert(L.cols() == 6); const int m = L.rows(); // (unsigned) face Areas (opposite vertices: 1 2 3 4) Matrix A0(m,1), A1(m,1), A2(m,1), A3(m,1); Matrix L0(m,3), L1(m,3), L2(m,3), L3(m,3); L0<, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); #endif