py_massmatrix.cpp 1.0 KB

1234567891011121314151617181920212223242526
  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. py::enum_<igl::MassMatrixType>(m, "MassMatrixType")
  9. .value("MASSMATRIX_TYPE_BARYCENTRIC", igl::MASSMATRIX_TYPE_BARYCENTRIC)
  10. .value("MASSMATRIX_TYPE_VORONOI", igl::MASSMATRIX_TYPE_VORONOI)
  11. .value("MASSMATRIX_TYPE_FULL", igl::MASSMATRIX_TYPE_FULL)
  12. .value("MASSMATRIX_TYPE_DEFAULT", igl::MASSMATRIX_TYPE_DEFAULT)
  13. .value("NUM_MASSMATRIX_TYPE", igl::NUM_MASSMATRIX_TYPE)
  14. .export_values();
  15. m.def("massmatrix", []
  16. (
  17. const Eigen::MatrixXd& V,
  18. const Eigen::MatrixXi& F,
  19. const igl::MassMatrixType type,
  20. Eigen::SparseMatrix<double>& M
  21. )
  22. {
  23. return igl::massmatrix(V,F,type,M);
  24. }, __doc_igl_massmatrix,
  25. py::arg("V"), py::arg("F"), py::arg("type"), py::arg("M"));