py_nrosy.cpp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2017 Sebastian Koch <s.koch@tu-berlin.de> and Daniele Panozzo <daniele.panozzo@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. m.def("nrosy", []
  9. (
  10. const Eigen::MatrixXd& V,
  11. const Eigen::MatrixXi& F,
  12. const Eigen::MatrixXi& b,
  13. const Eigen::MatrixXd& bc,
  14. const Eigen::MatrixXi& b_soft,
  15. const Eigen::MatrixXd& w_soft,
  16. const Eigen::MatrixXd& bc_soft,
  17. const int N,
  18. const double soft,
  19. Eigen::MatrixXd& R,
  20. Eigen::MatrixXd& S
  21. )
  22. {
  23. assert_is_VectorX("b",b);
  24. assert_is_VectorX("b_soft",b_soft);
  25. assert_is_VectorX("w_soft",w_soft);
  26. Eigen::VectorXi bt;
  27. if (b.size() != 0)
  28. bt = b;
  29. Eigen::VectorXi b_softt;
  30. if (b_soft.size() != 0)
  31. b_softt = b_soft;
  32. Eigen::VectorXd w_softt;
  33. if (w_soft.size() != 0)
  34. w_softt = w_soft;
  35. Eigen::VectorXd St;
  36. igl::copyleft::comiso::nrosy(V,F,bt,bc,b_softt,w_softt,bc_soft,N,soft,R,St);
  37. S = St;
  38. }, __doc_igl_copyleft_comiso_nrosy,
  39. py::arg("V"), py::arg("F"), py::arg("b"), py::arg("bc"), py::arg("b_soft"), py::arg("w_soft"), py::arg("bc_soft"), py::arg("N"), py::arg("soft"), py::arg("R"), py::arg("S"));
  40. m.def("nrosy", []
  41. (
  42. const Eigen::MatrixXd& V,
  43. const Eigen::MatrixXi& F,
  44. const Eigen::MatrixXi& b,
  45. const Eigen::MatrixXd& bc,
  46. const int N,
  47. Eigen::MatrixXd& R,
  48. Eigen::MatrixXd& S
  49. )
  50. {
  51. assert_is_VectorX("b",b);
  52. Eigen::VectorXi bt;
  53. if (b.size() != 0)
  54. bt = b;
  55. Eigen::VectorXd St;
  56. igl::copyleft::comiso::nrosy(V,F,bt,bc,N,R,St);
  57. S = St;
  58. }, __doc_igl_copyleft_comiso_nrosy,
  59. py::arg("V"), py::arg("F"), py::arg("b"), py::arg("bc"), py::arg("N"), py::arg("R"), py::arg("S"));