gen_geometry_utils.cpp 2.1 KB

123456789101112131415161718192021222324252627282930313233
  1. /******************************************************************************
  2. *
  3. * Copyright (C) 2021 by
  4. * The Salk Institute for Biological Studies
  5. *
  6. * Use of this source code is governed by an MIT-style
  7. * license that can be found in the LICENSE file or at
  8. * https://opensource.org/licenses/MIT.
  9. *
  10. ******************************************************************************/
  11. #include <sstream>
  12. #include "api/pybind11_stl_include.h"
  13. #include "api/python_export_utils.h"
  14. #include "gen_geometry_utils.h"
  15. #include "api/geometry_object.h"
  16. #include "api/model.h"
  17. namespace MCell {
  18. namespace API {
  19. void define_pybinding_geometry_utils(py::module& m) {
  20. m.def_submodule("geometry_utils")
  21. .def("create_box", &geometry_utils::create_box, py::arg("name"), py::arg("edge_dimension") = FLT_UNSET, py::arg("xyz_dimensions") = std::vector<double>(), "Creates a GeometryObject in the shape of a cube whose center is at (0, 0, 0).\n- name: Name of the created geometry object.\n\n- edge_dimension: Specifies length of each edge of the box in um. \nNone of x/y/z dimensions can be set.\n\n\n- xyz_dimensions: Specifies x/y/z sizes of the box in um. Parameter edge_dimension must not be set.\n\n")
  22. .def("create_icosphere", &geometry_utils::create_icosphere, py::arg("name"), py::arg("radius"), py::arg("subdivisions"), "Creates a GeometryObject in the shape of an icosphere whose center is at (0, 0, 0).\n- name: Name of the created geometry object.\n\n- radius: Specifies radius of the sphere.\n\n- subdivisions: Number of subdivisions from the initial icosphere. \nThe higher this value will be the smoother the icosphere will be.\nAllowed range is between 1 and 8.\n\n\n")
  23. .def("validate_volumetric_mesh", &geometry_utils::validate_volumetric_mesh, py::arg("model"), py::arg("geometry_object"), "Checks that the mesh was correctly analyzed, that it has volume and \nall edges have neighboring walls.\nMust be called after model initialization. \nThrows exception with detained message if validation did not pass. \n\n- model: Model object after initialization.\n\n- geometry_object: Geometry object to be checked.\n\n")
  24. ;
  25. }
  26. } // namespace API
  27. } // namespace MCell