From ddc50aa6512fd05f17054ab3eb83ce20eb54e9b8 Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Tue, 13 Feb 2024 09:33:12 +0100 Subject: [PATCH] throw exception if surface triangulation cannot be built by occ --- libsrc/occ/occgenmesh.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libsrc/occ/occgenmesh.cpp b/libsrc/occ/occgenmesh.cpp index 656b8e36..7eb2d77d 100644 --- a/libsrc/occ/occgenmesh.cpp +++ b/libsrc/occ/occgenmesh.cpp @@ -669,6 +669,8 @@ 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?"); BRepAdaptor_Surface sf(face, Standard_True); // one prop for evaluating and one for derivatives