// This file is part of libigl, a simple c++ geometry processing library. // // Copyright (C) 2014 Daniele Panozzo , Olga Diamanti // // 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_FIND_CROSS_FIELD_SINGULARITIES_H #define IGL_FIND_CROSS_FIELD_SINGULARITIES_H #include "igl_inline.h" #include namespace igl { // Computes singularities of a cross field, assumed combed // Inputs: // V #V by 3 eigen Matrix of mesh vertex 3D positions // F #F by 3 eigen Matrix of face (quad) indices // mismatch #F by 3 eigen Matrix containing the integer mismatch of the cross field // across all face edges // Output: // isSingularity #V by 1 boolean eigen Vector indicating the presence of a singularity on a vertex // singularityIndex #V by 1 integer eigen Vector containing the singularity indices // template IGL_INLINE void find_cross_field_singularities(const Eigen::PlainObjectBase &V, const Eigen::PlainObjectBase &F, const Eigen::PlainObjectBase &mismatch, Eigen::PlainObjectBase &isSingularity, Eigen::PlainObjectBase &singularityIndex); // Wrapper that calculates the mismatch if it is not provided. // Note that the field in PD1 and PD2 MUST BE combed (see igl::comb_cross_field). // Inputs: // V #V by 3 eigen Matrix of mesh vertex 3D positions // F #F by 3 eigen Matrix of face (quad) indices // PD1 #F by 3 eigen Matrix of the first per face cross field vector // PD2 #F by 3 eigen Matrix of the second per face cross field vector // Output: // isSingularity #V by 1 boolean eigen Vector indicating the presence of a singularity on a vertex // singularityIndex #V by 1 integer eigen Vector containing the singularity indices // template IGL_INLINE void find_cross_field_singularities(const Eigen::PlainObjectBase &V, const Eigen::PlainObjectBase &F, const Eigen::PlainObjectBase &PD1, const Eigen::PlainObjectBase &PD2, Eigen::PlainObjectBase &isSingularity, Eigen::PlainObjectBase &singularityIndex, bool isCombed = false); } #ifndef IGL_STATIC_LIBRARY #include "find_cross_field_singularities.cpp" #endif #endif