py_marching_cubes.cpp 1007 B

12345678910111213141516171819202122232425262728
  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("marching_cubes", []
  9. (
  10. const Eigen::MatrixXd& values,
  11. const Eigen::MatrixXd& points,
  12. const unsigned int x_res,
  13. const unsigned int y_res,
  14. const unsigned int z_res,
  15. Eigen::MatrixXd& vertices,
  16. Eigen::MatrixXi& faces
  17. )
  18. {
  19. assert_is_VectorX("values", values);
  20. Eigen::VectorXd valuesv;
  21. if (values.size() != 0)
  22. valuesv = values;
  23. return igl::copyleft::marching_cubes(valuesv, points, x_res, y_res, z_res, vertices, faces);
  24. }, __doc_igl_copyleft_marching_cubes,
  25. py::arg("values"), py::arg("points"), py::arg("x_res"), py::arg("y_res"), py::arg("z_res"), py::arg("vertices"), py::arg("faces"));