boundary_conditions.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <[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_BOUNDARY_CONDITIONS_H
  9. #define IGL_BOUNDARY_CONDITIONS_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Dense>
  12. namespace igl
  13. {
  14. /// Compute boundary conditions for automatic weights computation. This
  15. /// function expects that the given mesh (V,Ele) has sufficient samples
  16. /// (vertices) exactly at point handle locations and exactly along bone and
  17. /// cage edges/faces.
  18. ///
  19. /// @param[in] V #V by dim list of domain vertices
  20. /// @param[in] Ele #Ele by simplex-size list of simplex indices
  21. /// @param[in] C #C by dim list of handle positions
  22. /// @param[in] P #P by 1 list of point handle indices into C
  23. /// @param[in] BE #BE by 2 list of bone edge indices into C
  24. /// @param[in] CE #CE by 2 list of cage edge indices into *P*
  25. /// @param[in] CF #CF by 3 list of (triangular) cage face indices into *P*
  26. /// @param[out] b #b list of boundary indices (indices into V of vertices which have
  27. /// known, fixed values)
  28. /// @param[out] bc #b by #weights list of known/fixed values for boundary vertices
  29. /// (notice the #b != #weights in general because #b will include all the
  30. /// intermediary samples along each bone, etc.. The ordering of the
  31. /// weights corresponds to [P;BE]
  32. /// @return false if boundary conditions are suspicious:
  33. /// P and BE are empty
  34. /// bc is empty
  35. /// some column of bc doesn't have a 0 (assuming bc has >1 columns)
  36. /// some column of bc doesn't have a 1 (assuming bc has >1 columns)
  37. ///
  38. template <
  39. typename DerivedV,
  40. typename DerivedEle,
  41. typename DerivedC,
  42. typename DerivedP,
  43. typename DerivedBE,
  44. typename DerivedCE,
  45. typename DerivedCF,
  46. typename Derivedb,
  47. typename Derivedbc>
  48. IGL_INLINE bool boundary_conditions(
  49. const Eigen::MatrixBase<DerivedV> & V,
  50. const Eigen::MatrixBase<DerivedEle> & Ele,
  51. const Eigen::MatrixBase<DerivedC> & C,
  52. const Eigen::MatrixBase<DerivedP> & P,
  53. const Eigen::MatrixBase<DerivedBE> & BE,
  54. const Eigen::MatrixBase<DerivedCE> & CE,
  55. const Eigen::MatrixBase<DerivedCF> & CF,
  56. Eigen::PlainObjectBase<Derivedb> & b,
  57. Eigen::PlainObjectBase<Derivedbc> & bc);
  58. }
  59. #ifndef IGL_STATIC_LIBRARY
  60. # include "boundary_conditions.cpp"
  61. #endif
  62. #endif