py_bbw.cpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. // Wrap the BBWData class
  9. py::class_<igl::BBWData > BBWData(m, "BBWData");
  10. BBWData
  11. .def(py::init<>())
  12. .def_readwrite("partition_unity", &igl::BBWData::partition_unity)
  13. .def_readwrite("W0", &igl::BBWData::W0)
  14. .def_readwrite("active_set_params", &igl::BBWData::active_set_params)
  15. .def_readwrite("verbosity", &igl::BBWData::verbosity)
  16. .def("print", [](igl::BBWData& data)
  17. {
  18. return data.print();
  19. })
  20. ;
  21. m.def("bbw", []
  22. (
  23. const Eigen::MatrixXd& V,
  24. const Eigen::MatrixXi& Ele,
  25. const Eigen::MatrixXi& b,
  26. const Eigen::MatrixXd& bc,
  27. igl::BBWData& data,
  28. Eigen::MatrixXd& W
  29. )
  30. {
  31. assert_is_VectorX("b",b);
  32. Eigen::VectorXi bv;
  33. if (b.size() != 0)
  34. bv = b;
  35. return igl::bbw(V, Ele, bv, bc, data, W);
  36. }, __doc_igl_bbw,
  37. py::arg("V"), py::arg("Ele"), py::arg("b"), py::arg("bc"), py::arg("data"), py::arg("W"));