cross_field_missmatch.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2014 Daniele Panozzo <daniele.panozzo@gmail.com>, Olga Diamanti <olga.diam@gmail.com>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. #ifndef IGL_CROSS_FIELD_MISSMATCH_H
  9. #define IGL_CROSS_FIELD_MISSMATCH_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. // Calculates the missmatch (integer), at each face edge, of a cross field defined on the mesh faces.
  15. // The integer missmatch is a multiple of pi/2 that transforms the cross on one side of the edge to
  16. // the cross on the other side. It represents the deviation from a Lie connection across the edge.
  17. // Inputs:
  18. // V #V by 3 eigen Matrix of mesh vertex 3D positions
  19. // F #F by 3 eigen Matrix of face (quad) indices
  20. // PD1 #F by 3 eigen Matrix of the first per face cross field vector
  21. // PD2 #F by 3 eigen Matrix of the second per face cross field vector
  22. // isCombed boolean, specifying whether the field is combed (i.e. matching has been precomputed.
  23. // If not, the field is combed first.
  24. // Output:
  25. // Handle_MMatch #F by 3 eigen Matrix containing the integer missmatch of the cross field
  26. // across all face edges
  27. //
  28. template <typename DerivedV, typename DerivedF, typename DerivedM>
  29. IGL_INLINE void cross_field_missmatch(const Eigen::PlainObjectBase<DerivedV> &V,
  30. const Eigen::PlainObjectBase<DerivedF> &F,
  31. const Eigen::PlainObjectBase<DerivedV> &PD1,
  32. const Eigen::PlainObjectBase<DerivedV> &PD2,
  33. const bool isCombed,
  34. Eigen::PlainObjectBase<DerivedM> &missmatch);
  35. }
  36. #ifndef IGL_STATIC_LIBRARY
  37. #include "cross_field_missmatch.cpp"
  38. #endif
  39. #endif