mesh_with_skeleton.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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_TETGEN_MESH_WITH_SKELETON_H
  9. #define IGL_TETGEN_MESH_WITH_SKELETON_H
  10. #include "../igl_inline.h"
  11. #include <Eigen/Dense>
  12. #include <string>
  13. namespace igl
  14. {
  15. namespace tetgen
  16. {
  17. // Mesh the interior of a given surface with tetrahedra which are graded
  18. // (tend to be small near the surface and large inside) and conform to the
  19. // given handles and samplings thereof.
  20. //
  21. // Inputs:
  22. // V #V by 3 list of mesh vertex positions
  23. // F #F by 3 list of triangle indices
  24. // C #C by 3 list of vertex positions
  25. // P #P list of point handle indices
  26. // BE #BE by 2 list of bone-edge indices
  27. // CE #CE by 2 list of cage-edge indices
  28. // samples_per_bone #samples to add per bone
  29. // tetgen_flags flags to pass to tetgen {""-->"pq2Y"} otherwise you're on
  30. // your own and it's your funeral if you pass nonsense flags
  31. // Outputs:
  32. // VV #VV by 3 list of tet-mesh vertex positions
  33. // TT #TT by 4 list of tetrahedra indices
  34. // FF #FF by 3 list of surface triangle indices
  35. // Returns true only on success
  36. IGL_INLINE bool mesh_with_skeleton(
  37. const Eigen::MatrixXd & V,
  38. const Eigen::MatrixXi & F,
  39. const Eigen::MatrixXd & C,
  40. const Eigen::VectorXi & /*P*/,
  41. const Eigen::MatrixXi & BE,
  42. const Eigen::MatrixXi & CE,
  43. const int samples_per_bone,
  44. const std::string & tetgen_flags,
  45. Eigen::MatrixXd & VV,
  46. Eigen::MatrixXi & TT,
  47. Eigen::MatrixXi & FF);
  48. // Wrapper using default tetgen_flags
  49. IGL_INLINE bool mesh_with_skeleton(
  50. const Eigen::MatrixXd & V,
  51. const Eigen::MatrixXi & F,
  52. const Eigen::MatrixXd & C,
  53. const Eigen::VectorXi & /*P*/,
  54. const Eigen::MatrixXi & BE,
  55. const Eigen::MatrixXi & CE,
  56. const int samples_per_bone,
  57. Eigen::MatrixXd & VV,
  58. Eigen::MatrixXi & TT,
  59. Eigen::MatrixXi & FF);
  60. }
  61. }
  62. #ifndef IGL_STATIC_LIBRARY
  63. # include "mesh_with_skeleton.cpp"
  64. #endif
  65. #endif