line_field_missmatch.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2014 Nico Pietroni <nico.pietroni@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_LINE_FIELD_MISSMATCH_H
  9. #define IGL_LINE_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 DerivedO>
  29. IGL_INLINE void line_field_missmatch(const Eigen::PlainObjectBase<DerivedV> &V,
  30. const Eigen::PlainObjectBase<DerivedF> &F,
  31. const Eigen::PlainObjectBase<DerivedV> &PD1,
  32. const bool isCombed,
  33. Eigen::PlainObjectBase<DerivedO> &missmatch);
  34. }
  35. #ifndef IGL_STATIC_LIBRARY
  36. #include "line_field_missmatch.cpp"
  37. #endif
  38. #endif