uniformly_sample_two_manifold.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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_UNIFORMLY_SAMPLE_TWO_MANIFOLD_H
  9. #define IGL_UNIFORMLY_SAMPLE_TWO_MANIFOLD_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Dense>
  12. namespace igl
  13. {
  14. // UNIFORMLY_SAMPLE_TWO_MANIFOLD Attempt to sample a mesh uniformly by
  15. // furthest point relaxation as described in "Fast Automatic Skinning
  16. // Transformations"
  17. //
  18. // [Jacobson et al. 12] Section 3.3.
  19. //
  20. // Inputs:
  21. // W #W by dim positions of mesh in weight space
  22. // F #F by 3 indices of triangles
  23. // k number of samplse
  24. // push factor by which corners should be pushed away
  25. // Outputs
  26. // WS k by dim locations in weights space
  27. //
  28. IGL_INLINE void uniformly_sample_two_manifold(
  29. const Eigen::MatrixXd & W,
  30. const Eigen::MatrixXi & F,
  31. const int k,
  32. const double push,
  33. Eigen::MatrixXd & WS);
  34. // Find uniform sampling up to placing samples on mesh vertices
  35. IGL_INLINE void uniformly_sample_two_manifold_at_vertices(
  36. const Eigen::MatrixXd & OW,
  37. const int k,
  38. const double push,
  39. Eigen::VectorXi & S);
  40. }
  41. #ifndef IGL_STATIC_LIBRARY
  42. # include "uniformly_sample_two_manifold.cpp"
  43. #endif
  44. #endif