From b9596765341d69910dd97f73c47598696323495e Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Wed, 21 Feb 2024 15:14:33 +0100 Subject: [PATCH] check for infinite shape --- libsrc/occ/occgenmesh.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libsrc/occ/occgenmesh.cpp b/libsrc/occ/occgenmesh.cpp index 7eb2d77d..1e373ca5 100644 --- a/libsrc/occ/occgenmesh.cpp +++ b/libsrc/occ/occgenmesh.cpp @@ -669,9 +669,15 @@ namespace netgen BRepMesh_IncrementalMesh (geom.shape, 0.01, true); triangulation = BRep_Tool::Triangulation (face, loc); } + if(triangulation.IsNull()) - throw Exception("OCC-Triangulation could not be built. Do you have a bounded shape?"); - + { + if (geom.shape.Infinite()) + throw Exception("Cannot generate mesh for an infinite geometry"); + else + throw Exception("OCC-Triangulation could not be built"); + } + BRepAdaptor_Surface sf(face, Standard_True); // one prop for evaluating and one for derivatives BRepLProp_SLProps prop(sf, 0, 1e-5);