mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-23 19:30:33 +05:00
[occ] create solid from faces
Needs shape consisting of topologically closed faces, for example from Solid(Glue(list_of_faces))`
This commit is contained in:
parent
94bd713310
commit
c822caafe7
@ -1453,7 +1453,20 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
|
||||
return builder.Projection();
|
||||
})
|
||||
;
|
||||
py::class_<TopoDS_Solid, TopoDS_Shape> (m, "Solid");
|
||||
py::class_<TopoDS_Solid, TopoDS_Shape> (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_<TopoDS_Compound, TopoDS_Shape> (m, "Compound")
|
||||
.def(py::init([](std::vector<TopoDS_Shape> shapes, bool separate_layers) {
|
||||
|
Loading…
Reference in New Issue
Block a user