mesh_with_skeleton.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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_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. /// @param[in] V #V by 3 list of mesh vertex positions
  24. /// @param[in] F #F by 3 list of triangle indices
  25. /// @param[in] C #C by 3 list of vertex positions
  26. /// @param[in] P #P list of point handle indices
  27. /// @param[in] BE #BE by 2 list of bone-edge indices
  28. /// @param[in] CE #CE by 2 list of cage-edge indices
  29. /// @param[in] samples_per_bone #samples to add per bone
  30. /// @param[in] tetgen_flags flags to pass to tetgen {""-->"pq2Y"} otherwise you're on
  31. /// your own and it's your funeral if you pass nonsense flags
  32. /// @param[out] VV #VV by 3 list of tet-mesh vertex positions
  33. /// @param[out] TT #TT by 4 list of tetrahedra indices
  34. /// @param[out] FF #FF by 3 list of surface triangle indices
  35. /// @return 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. /// \overload
  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. }
  63. #ifndef IGL_STATIC_LIBRARY
  64. # include "mesh_with_skeleton.cpp"
  65. #endif
  66. #endif