compute_frame_field_bisectors.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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_COMPUTE_FRAME_FIELD_BISECTORS_H
  9. #define IGL_COMPUTE_FRAME_FIELD_BISECTORS_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. // Compute bisectors of a frame field defined on mesh faces
  15. // Inputs:
  16. // V #V by 3 eigen Matrix of mesh vertex 3D positions
  17. // F #F by 3 eigen Matrix of face (triangle) indices
  18. // B1 #F by 3 eigen Matrix of face (triangle) base vector 1
  19. // B2 #F by 3 eigen Matrix of face (triangle) base vector 2
  20. // PD1 #F by 3 eigen Matrix of the first per face frame field vector
  21. // PD2 #F by 3 eigen Matrix of the second per face frame field vector
  22. // Output:
  23. // BIS1 #F by 3 eigen Matrix of the first per face frame field bisector
  24. // BIS2 #F by 3 eigen Matrix of the second per face frame field bisector
  25. //
  26. template <typename DerivedV, typename DerivedF>
  27. IGL_INLINE void compute_frame_field_bisectors(
  28. const Eigen::PlainObjectBase<DerivedV>& V,
  29. const Eigen::PlainObjectBase<DerivedF>& F,
  30. const Eigen::PlainObjectBase<DerivedV>& B1,
  31. const Eigen::PlainObjectBase<DerivedV>& B2,
  32. const Eigen::PlainObjectBase<DerivedV>& PD1,
  33. const Eigen::PlainObjectBase<DerivedV>& PD2,
  34. Eigen::PlainObjectBase<DerivedV>& BIS1,
  35. Eigen::PlainObjectBase<DerivedV>& BIS2);
  36. // Wrapper without given basis vectors.
  37. template <typename DerivedV, typename DerivedF>
  38. IGL_INLINE void compute_frame_field_bisectors(
  39. const Eigen::PlainObjectBase<DerivedV>& V,
  40. const Eigen::PlainObjectBase<DerivedF>& F,
  41. const Eigen::PlainObjectBase<DerivedV>& PD1,
  42. const Eigen::PlainObjectBase<DerivedV>& PD2,
  43. Eigen::PlainObjectBase<DerivedV>& BIS1,
  44. Eigen::PlainObjectBase<DerivedV>& BIS2);
  45. }
  46. #ifndef IGL_STATIC_LIBRARY
  47. # include "compute_frame_field_bisectors.cpp"
  48. #endif
  49. #endif