From 788c78245532bc3cc2d45d82d1f5ff506fea0cfa Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Mon, 31 Mar 2025 09:16:44 +0200 Subject: [PATCH] OCCGeometry properties to query subshapes in netgen-order --- libsrc/occ/python_occ.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/libsrc/occ/python_occ.cpp b/libsrc/occ/python_occ.cpp index dd922e76..9924e341 100644 --- a/libsrc/occ/python_occ.cpp +++ b/libsrc/occ/python_occ.cpp @@ -168,6 +168,34 @@ DLL_HEADER void ExportNgOCC(py::module &m) { ng_geometry = geo; }) + .def_property_readonly("solids", [](shared_ptr geo) + { + ListOfShapes solids; + for (int i = 1; i <= geo->somap.Extent(); i++) + solids.push_back(geo->somap(i)); + return solids; + }, "Get solids in order that they will be in the mesh") + .def_property_readonly("faces", [](shared_ptr geo) + { + ListOfShapes faces; + for (int i = 1; i <= geo->fmap.Extent(); i++) + faces.push_back(geo->fmap(i)); + return faces; + }, "Get faces in order that they will be in the mesh") + .def_property_readonly("edges", [](shared_ptr geo) + { + ListOfShapes edges; + for (int i = 1; i <= geo->emap.Extent(); i++) + edges.push_back(geo->emap(i)); + return edges; + }, "Get edges in order that they will be in the mesh") + .def_property_readonly("vertices", [](shared_ptr geo) + { + ListOfShapes vertices; + for (int i = 1; i <= geo->vmap.Extent(); i++) + vertices.push_back(geo->vmap(i)); + return vertices; + }, "Get vertices in order that they will be in the mesh") .def("_visualizationData", [] (shared_ptr occ_geo) { std::vector vertices;