mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 21:10:33 +05:00
OCCGeometry from list of shapes
This commit is contained in:
parent
5066fe0fce
commit
ca0201b301
@ -70,11 +70,33 @@ DLL_HEADER void ExportNgOCC(py::module &m)
|
|||||||
|
|
||||||
geo->BuildFMap();
|
geo->BuildFMap();
|
||||||
geo->CalcBoundingBox();
|
geo->CalcBoundingBox();
|
||||||
// PrintContents (geo);
|
|
||||||
cout << "bounding box = " << geo->GetBoundingBox() << endl;
|
|
||||||
return geo;
|
return geo;
|
||||||
}), py::arg("shape"),
|
}), py::arg("shape"),
|
||||||
"Create Netgen OCCGeometry from existing TopoDS_Shape")
|
"Create Netgen OCCGeometry from existing TopoDS_Shape")
|
||||||
|
|
||||||
|
.def(py::init([] (const std::vector<TopoDS_Shape> shapes)
|
||||||
|
{
|
||||||
|
BOPAlgo_Builder aBuilder;
|
||||||
|
|
||||||
|
// Setting arguments
|
||||||
|
TopTools_ListOfShape aLSObjects;
|
||||||
|
/*
|
||||||
|
for (TopExp_Explorer exp_solid(shape, TopAbs_SOLID); exp_solid.More(); exp_solid.Next())
|
||||||
|
aLSObjects.Append (exp_solid.Current());
|
||||||
|
*/
|
||||||
|
for (auto & s : shapes)
|
||||||
|
aLSObjects.Append (s);
|
||||||
|
aBuilder.SetArguments(aLSObjects);
|
||||||
|
aBuilder.Perform();
|
||||||
|
|
||||||
|
auto geo = make_shared<OCCGeometry> (aBuilder.Shape());
|
||||||
|
ng_geometry = geo;
|
||||||
|
geo->BuildFMap();
|
||||||
|
geo->CalcBoundingBox();
|
||||||
|
return geo;
|
||||||
|
}), py::arg("shape"),
|
||||||
|
"Create Netgen OCCGeometry from existing TopoDS_Shape")
|
||||||
|
|
||||||
.def(py::init([] (const string& filename)
|
.def(py::init([] (const string& filename)
|
||||||
{
|
{
|
||||||
shared_ptr<OCCGeometry> geo;
|
shared_ptr<OCCGeometry> geo;
|
||||||
|
Loading…
Reference in New Issue
Block a user