From f54c47bac6bd989dbbf808f3ae78ca2284e9b705 Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Tue, 19 Nov 2019 10:00:05 +0100 Subject: [PATCH] if tangent is not defined and not checked this leads to segfault --- libsrc/occ/occgenmesh.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libsrc/occ/occgenmesh.cpp b/libsrc/occ/occgenmesh.cpp index 8b00b684..9a714f8c 100644 --- a/libsrc/occ/occgenmesh.cpp +++ b/libsrc/occ/occgenmesh.cpp @@ -1110,7 +1110,9 @@ namespace netgen { double s = s0 + j/(double) nsections * (s1-s0); prop.SetParameter (s); - double curvature = prop.Curvature(); + double curvature = 0; + if(prop.IsTangentDefined()) + curvature = prop.Curvature(); if(curvature> maxcur) maxcur = curvature; if (curvature >= 1e99)