diff --git a/libsrc/meshing/python_mesh.cpp b/libsrc/meshing/python_mesh.cpp index 1b1a35a9..c125c3de 100644 --- a/libsrc/meshing/python_mesh.cpp +++ b/libsrc/meshing/python_mesh.cpp @@ -983,6 +983,8 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m) self.CalcLocalH(0.5); MeshingParameters mp; mp.optsteps2d = 5; + if(!self.GetGeometry()) + throw Exception("Cannot optimize surface mesh without geometry!"); Optimize2d (self, mp); },py::call_guard())