From 9ae05ab71260c392981c172e89f8caad7e72bb6d Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Tue, 25 Jul 2023 12:11:13 +0200 Subject: [PATCH] add mesh.bounding_box in Python --- libsrc/meshing/python_mesh.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libsrc/meshing/python_mesh.cpp b/libsrc/meshing/python_mesh.cpp index 0ef1332a..eea4c3be 100644 --- a/libsrc/meshing/python_mesh.cpp +++ b/libsrc/meshing/python_mesh.cpp @@ -753,6 +753,11 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m) .def_property_readonly("_timestamp", &Mesh::GetTimeStamp) .def_property_readonly("ne", [](Mesh& m) { return m.GetNE(); }) + .def_property_readonly("bounding_box", [](Mesh& m) { + Point3d pmin, pmax; + m.GetBox(pmin, pmax); + return py::make_tuple( Point<3>(pmin),Point<3>(pmax)); + }) .def("Partition", [](shared_ptr self, int numproc) { self->ParallelMetis(numproc); }, py::arg("numproc"))