line_field_mismatch.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2014 Nico Pietroni <[email protected]>
  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 mismatch (integer), at each face edge, of a cross field defined on the mesh faces.
  15. /// The integer mismatch 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. ///
  18. /// @param[in] V #V by 3 eigen Matrix of mesh vertex 3D positions
  19. /// @param[in] F #F by 3 eigen Matrix of face (quad) indices
  20. /// @param[in] PD1 #F by 3 eigen Matrix of the first per face cross field vector
  21. /// @param[in] PD2 #F by 3 eigen Matrix of the second per face cross field vector
  22. /// @param[in] isCombed boolean, specifying whether the field is combed (i.e. matching has been precomputed.
  23. /// If not, the field is combed first.
  24. /// @param[out] mismatch #F by 3 eigen Matrix containing the integer mismatch of the cross field
  25. /// across all face edges
  26. ///
  27. template <typename DerivedV, typename DerivedF, typename DerivedO>
  28. IGL_INLINE void line_field_mismatch(
  29. const Eigen::MatrixBase<DerivedV> &V,
  30. const Eigen::MatrixBase<DerivedF> &F,
  31. const Eigen::MatrixBase<DerivedV> &PD1,
  32. const bool isCombed,
  33. Eigen::PlainObjectBase<DerivedO> &mismatch);
  34. }
  35. #ifndef IGL_STATIC_LIBRARY
  36. #include "line_field_mismatch.cpp"
  37. #endif
  38. #endif