From 9b235b4388aa6d2d7cb59716868924db01dbe455 Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Wed, 9 Nov 2016 17:18:01 +0100 Subject: [PATCH] Export Ngx_Mesh to Python --- libsrc/meshing/python_mesh.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libsrc/meshing/python_mesh.cpp b/libsrc/meshing/python_mesh.cpp index 07ea777b..cf99678f 100644 --- a/libsrc/meshing/python_mesh.cpp +++ b/libsrc/meshing/python_mesh.cpp @@ -7,6 +7,8 @@ #include #include #include <../interface/writeuser.hpp> +#include +#include using namespace netgen; @@ -298,6 +300,10 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m) py::implicitly_convertible< int, PointIndex>(); + py::class_(m, "Ngx_Mesh") + .def(py::init>()) + .def_property_readonly("ngmesh", &Ngx_Mesh::GetMesh) + ; py::class_>(m, "Mesh") // .def(py::init<>("create empty mesh")) @@ -545,6 +551,7 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m) )) ; + py::implicitly_convertible< shared_ptr, Ngx_Mesh >(); typedef MeshingParameters MP;