// This file is part of libigl, a simple c++ geometry processing library. // // Copyright (C) 2015 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/. #ifndef IGL_PSEUDONORMAL_TEST_H #define IGL_PSEUDONORMAL_TEST_H #include "igl_inline.h" #include namespace igl { // Given a mesh (V,F), a query point q, and a point on (V,F) c, determine // whether q is inside (V,F) --> s=-1 or outside (V,F) s=1, based on the // sign of the dot product between (q-c) and n, where n is the normal _at c_, // carefully chosen according to [Bærentzen & Aanæs 2005] // // Inputs: // V #V by 3 list of vertex positions // F #F by 3 list of triangle indices // FN #F by 3 list of triangle normals // VN #V by 3 list of vertex normals (ANGLE WEIGHTING) // EN #E by 3 list of edge normals (UNIFORM WEIGHTING) // EMAP #F*3 mapping edges in F to E // q Query point // f index into F to face to which c belongs // c Point on (V,F) // Outputs: // s sign // n normal template < typename DerivedV, typename DerivedF, typename DerivedFN, typename DerivedVN, typename DerivedEN, typename DerivedEMAP, typename Derivedq, typename Derivedc, typename Scalar, typename Derivedn> IGL_INLINE void pseudonormal_test( const Eigen::MatrixBase & V, const Eigen::MatrixBase & F, const Eigen::MatrixBase & FN, const Eigen::MatrixBase & VN, const Eigen::MatrixBase & EN, const Eigen::MatrixBase & EMAP, const Eigen::MatrixBase & q, const int f, Eigen::PlainObjectBase & c, Scalar & s, Eigen::PlainObjectBase & n); template < typename DerivedV, typename DerivedF, typename DerivedEN, typename DerivedVN, typename Derivedq, typename Derivedc, typename Scalar, typename Derivedn> IGL_INLINE void pseudonormal_test( const Eigen::MatrixBase & V, const Eigen::MatrixBase & E, const Eigen::MatrixBase & EN, const Eigen::MatrixBase & VN, const Eigen::MatrixBase & q, const int e, Eigen::PlainObjectBase & c, Scalar & s, Eigen::PlainObjectBase & n); } #ifndef IGL_STATIC_LIBRARY # include "pseudonormal_test.cpp" #endif #endif