boundary_conditions.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <alecjacobson@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_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.
  18. //
  19. // Inputs:
  20. // V #V by dim list of domain vertices
  21. // Ele #Ele by simplex-size list of simplex indices
  22. // C #C by dim list of handle positions
  23. // P #P by 1 list of point handle indices into C
  24. // BE #BE by 2 list of bone edge indices into C
  25. // CE #CE by 2 list of cage edge indices into *P*
  26. // Outputs:
  27. // b #b list of boundary indices (indices into V of vertices which have
  28. // known, fixed values)
  29. // bc #b by #weights list of known/fixed values for boundary vertices
  30. // (notice the #b != #weights in general because #b will include all the
  31. // intermediary samples along each bone, etc.. The ordering of the
  32. // weights corresponds to [P;BE]
  33. // Returns false if boundary conditions are suspicious:
  34. // P and BE are empty
  35. // bc is empty
  36. // some column of bc doesn't have a 0 (assuming bc has >1 columns)
  37. // some column of bc doesn't have a 1 (assuming bc has >1 columns)
  38. IGL_INLINE bool boundary_conditions(
  39. const Eigen::MatrixXd & V,
  40. const Eigen::MatrixXi & Ele,
  41. const Eigen::MatrixXd & C,
  42. const Eigen::VectorXi & P,
  43. const Eigen::MatrixXi & BE,
  44. const Eigen::MatrixXi & CE,
  45. Eigen::VectorXi & b,
  46. Eigen::MatrixXd & bc);
  47. }
  48. #ifndef IGL_STATIC_LIBRARY
  49. # include "boundary_conditions.cpp"
  50. #endif
  51. #endif