Merge branch 'import_mesh' into 'master'

import mesh from other file format from python

See merge request jschoeberl/netgen!133
This commit is contained in:
Joachim Schöberl 2019-02-15 19:54:46 +00:00
commit 0a14f5b5e1

View File

@ -898,8 +898,21 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
})) }))
; ;
m.def("ImportMesh", [](const string& filename)
{
auto mesh = make_shared<Mesh>();
ReadFile(*mesh, filename);
return mesh;
}, py::arg("filename"),
R"delimiter(Import mesh from other file format, supported file formats are:
Neutral format (*.mesh, *.emt)
Surface file (*.surf)
Universal format (*.unv)
Olaf format (*.emt)
Tet format (*.tet)
Pro/ENGINEER format (*.fnf)
)delimiter");
py::enum_<MESHING_STEP>(m,"MeshingStep") py::enum_<MESHING_STEP>(m,"MeshingStep")
.value("MESHEDGES",MESHCONST_MESHEDGES) .value("MESHEDGES",MESHCONST_MESHEDGES)
.value("MESHSURFACE",MESHCONST_OPTSURFACE) .value("MESHSURFACE",MESHCONST_OPTSURFACE)