if tangent is not defined and not checked this leads to segfault

This commit is contained in:
Christopher Lackner 2019-11-19 10:00:05 +01:00
parent 7e329eaa5a
commit f54c47bac6

View File

@ -1110,7 +1110,9 @@ namespace netgen
{ {
double s = s0 + j/(double) nsections * (s1-s0); double s = s0 + j/(double) nsections * (s1-s0);
prop.SetParameter (s); prop.SetParameter (s);
double curvature = prop.Curvature(); double curvature = 0;
if(prop.IsTangentDefined())
curvature = prop.Curvature();
if(curvature> maxcur) maxcur = curvature; if(curvature> maxcur) maxcur = curvature;
if (curvature >= 1e99) if (curvature >= 1e99)