mesh_with_skeleton.h 2.0 KB

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