diff --git a/libsrc/occ/python_occ_shapes.cpp b/libsrc/occ/python_occ_shapes.cpp index 4a4e021d..ca38c949 100644 --- a/libsrc/occ/python_occ_shapes.cpp +++ b/libsrc/occ/python_occ_shapes.cpp @@ -1453,7 +1453,20 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m) return builder.Projection(); }) ; - py::class_ (m, "Solid"); + py::class_ (m, "Solid") + .def(py::init([](const TopoDS_Shape& faces) + { + BRep_Builder builder; + TopoDS_Shell shell; + builder.MakeShell(shell); + for(auto& face : GetFaces(faces)) + builder.Add(shell, face); + TopoDS_Solid solid; + builder.MakeSolid(solid); + builder.Add(solid, shell); + return solid; + }), "Create solid from shell. Shell must consist of topologically closed faces (share vertices and edges).") + ; py::class_ (m, "Compound") .def(py::init([](std::vector shapes, bool separate_layers) {