mesh_with_skeleton.h 2.4 KB

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