uniformly_sample_two_manifold.h 1.4 KB

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