mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 21:10:33 +05:00
derive geometry class in python from NetgenGeometry, gil call guard
for generatemesh in 2d
This commit is contained in:
parent
8107052e79
commit
bc520769ba
@ -250,7 +250,7 @@ DLL_HEADER void ExportGeom2d(py::module &m)
|
||||
//cout << i << " : " << self.splines[i]->GetPoint(0.1) << " , " << self.splines[i]->GetPoint(0.5) << endl;
|
||||
}
|
||||
}))
|
||||
.def("GenerateMesh", FunctionPointer([](shared_ptr<SplineGeometry2d> self, MeshingParameters & mparam)
|
||||
.def("GenerateMesh", [](shared_ptr<SplineGeometry2d> self, MeshingParameters & mparam)
|
||||
{
|
||||
shared_ptr<Mesh> mesh = make_shared<Mesh> ();
|
||||
mesh->SetGeometry(self);
|
||||
@ -258,7 +258,7 @@ DLL_HEADER void ExportGeom2d(py::module &m)
|
||||
ng_geometry = self;
|
||||
self->GenerateMesh(mesh, mparam);
|
||||
return mesh;
|
||||
}))
|
||||
},py::call_guard<py::gil_scoped_release>())
|
||||
|
||||
;
|
||||
|
||||
|
@ -449,7 +449,7 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
|
||||
|
||||
py::implicitly_convertible< int, PointIndex>();
|
||||
|
||||
py::class_<NetgenGeometry, shared_ptr<NetgenGeometry>> (m, "NetgenGeometry")
|
||||
py::class_<NetgenGeometry, shared_ptr<NetgenGeometry>> (m, "NetgenGeometry", py::dynamic_attr())
|
||||
;
|
||||
|
||||
py::class_<Mesh,shared_ptr<Mesh>>(m, "Mesh")
|
||||
|
@ -16,7 +16,7 @@ namespace netgen
|
||||
|
||||
DLL_HEADER void ExportNgOCC(py::module &m)
|
||||
{
|
||||
py::class_<OCCGeometry, shared_ptr<OCCGeometry>> (m, "OCCGeometry", R"raw_string(Use LoadOCCGeometry to load the geometry from a *.step file.)raw_string")
|
||||
py::class_<OCCGeometry, shared_ptr<OCCGeometry>, NetgenGeometry> (m, "OCCGeometry", R"raw_string(Use LoadOCCGeometry to load the geometry from a *.step file.)raw_string")
|
||||
.def(py::init<>())
|
||||
.def("Heal",[](OCCGeometry & self, double tolerance, bool fixsmalledges, bool fixspotstripfaces, bool sewfaces, bool makesolids, bool splitpartitions)
|
||||
{
|
||||
|
@ -18,7 +18,7 @@ namespace netgen
|
||||
|
||||
DLL_HEADER void ExportSTL(py::module & m)
|
||||
{
|
||||
py::class_<STLGeometry,shared_ptr<STLGeometry>> (m,"STLGeometry")
|
||||
py::class_<STLGeometry,shared_ptr<STLGeometry>, NetgenGeometry> (m,"STLGeometry")
|
||||
.def(py::init<>())
|
||||
;
|
||||
m.def("LoadSTLGeometry", FunctionPointer([] (const string & filename)
|
||||
|
@ -98,7 +98,7 @@ namespace netgen
|
||||
|
||||
|
||||
|
||||
class STLGeometry : public STLTopology, public NetgenGeometry
|
||||
class STLGeometry : public NetgenGeometry, public STLTopology
|
||||
{
|
||||
// edges to be meshed:
|
||||
Array<STLEdge> edges;
|
||||
|
Loading…
Reference in New Issue
Block a user