map_vertices_to_circle.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2014 Stefan Brugger <stefanbrugger@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_MAP_VERTICES_TO_CIRCLE_H
  9. #define IGL_MAP_VERTICES_TO_CIRCLE_H
  10. #include "igl_inline.h"
  11. #include "PI.h"
  12. #include <Eigen/Dense>
  13. #include <vector>
  14. namespace igl
  15. {
  16. // Map the vertices whose indices are in a given boundary loop (bnd) on the
  17. // unit circle with spacing proportional to the original boundary edge
  18. // lengths.
  19. //
  20. // Inputs:
  21. // V #V by dim list of mesh vertex positions
  22. // b #W list of vertex ids
  23. // Outputs:
  24. // UV #W by 2 list of 2D position on the unit circle for the vertices in b
  25. IGL_INLINE void map_vertices_to_circle(
  26. const Eigen::MatrixXd& V,
  27. const Eigen::VectorXi& bnd,
  28. Eigen::MatrixXd& UV);
  29. }
  30. #ifndef IGL_STATIC_LIBRARY
  31. # include "map_vertices_to_circle.cpp"
  32. #endif
  33. #endif