// This file is part of libigl, a simple c++ geometry processing library. // // Copyright (C) 2013 Daniele Panozzo // // 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/. #ifndef IGL_BARYCENTRIC2GLOBAL_H #define IGL_BARYCENTRIC2GLOBAL_H #include #include #include namespace igl { // Converts barycentric coordinates in the embree form to 3D coordinates // Embree stores barycentric coordinates as triples: fid, bc1, bc2 // fid is the id of a face, bc1 is the displacement of the point wrt the // first vertex v0 and the edge v1-v0. Similarly, bc2 is the displacement // wrt v2-v0. // // Input: // V: #Vx3 Vertices of the mesh // F: #Fxe Faces of the mesh // bc: #Xx3 Barycentric coordinates, one row per point // // Output: // #X: #Xx3 3D coordinates of all points in bc template IGL_INLINE Eigen::Matrix barycentric_to_global( const Eigen::Matrix & V, const Eigen::Matrix & F, const Eigen::Matrix & bc); } #ifndef IGL_STATIC_LIBRARY # include "barycentric_to_global.cpp" #endif #endif