diff --git a/libsrc/meshing/meshclass.cpp b/libsrc/meshing/meshclass.cpp index d4ac238c..e324ebba 100644 --- a/libsrc/meshing/meshclass.cpp +++ b/libsrc/meshing/meshclass.cpp @@ -6838,11 +6838,12 @@ namespace netgen continue; auto pt = (*this)[pi]; auto mapped_pt = mapping(pt); - auto other_nr = GetElementOfPoint(mapped_pt, lami, true); + // auto other_nr = GetElementOfPoint(mapped_pt, lami, true); + auto other_nr = GetSurfaceElementOfPoint(mapped_pt, lami); int index = -1; if(other_nr != 0) { - auto other_el = VolumeElement(other_nr); + auto other_el = SurfaceElement(other_nr); for(auto i : Range(other_el.PNums().Size())) if((mapped_pt - (*this)[other_el.PNums()[i]]).Length() < pointTolerance) { diff --git a/libsrc/meshing/python_mesh.cpp b/libsrc/meshing/python_mesh.cpp index 11209a84..024a56db 100644 --- a/libsrc/meshing/python_mesh.cpp +++ b/libsrc/meshing/python_mesh.cpp @@ -203,6 +203,15 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m) .def("__mul__", [](Transformation<3> a, Transformation<3> b)->Transformation<3> { Transformation<3> res; res.Combine(a,b); return res; }) .def("__call__", [] (Transformation<3> trafo, Point<3> p) { return trafo(p); }) + .def_property("mat", &Transformation<3>::GetMatrix, + [](Transformation<3>& self, py::array_t np_mat) + { + if(np_mat.size() != 9) + throw Exception("Invalid dimension of input array!"); + for(int i = 0; i < 3; i++) + for(int j = 0; j < 3; j++) + self.GetMatrix()(i,j) = np_mat.at(i*3+j); + }) ; m.def ("GetTransformation", [] () { return global_trafo; });