From: eap Date: Fri, 21 Jan 2011 17:45:09 +0000 (+0000) Subject: 0021131: EDF 1167 NETGENPLUGIN: SIGSEGV when trying to mesh a shape with degenerated... X-Git-Tag: Start_BR_19998_21191~12 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c4fe195950af3160a2748a770d4107c4922398e4;p=plugins%2Fnetgenplugin.git 0021131: EDF 1167 NETGENPLUGIN: SIGSEGV when trying to mesh a shape with degenerated edges prevent access to NULL curve of the degenerated edge --- diff --git a/src/NETGENPlugin/NETGENPlugin_Mesher.cxx b/src/NETGENPlugin/NETGENPlugin_Mesher.cxx index be72348..f36f61a 100644 --- a/src/NETGENPlugin/NETGENPlugin_Mesher.cxx +++ b/src/NETGENPlugin/NETGENPlugin_Mesher.cxx @@ -1416,17 +1416,28 @@ namespace const int nb = 1000; Standard_Real u1, u2; Handle(Geom_Curve) curve = BRep_Tool::Curve(edge, u1, u2); - Standard_Real delta = (u2-u1)/nb; - for(int i=0; iValue(u); + TopoDS_Iterator vIt( edge ); + if ( !vIt.More() ) return; + gp_Pnt p = BRep_Tool::Pnt( TopoDS::Vertex( vIt.Value() )); netgen::Point3d pi(p.X(), p.Y(), p.Z()); mesh.RestrictLocalH(pi, size); - double resultSize = mesh.GetH(pi); - if ( resultSize - size > 0.1*size ) - // netgen does restriction iff oldH/newH > 1.2 (localh.cpp:136) - mesh.RestrictLocalH(pi, resultSize/1.201); + } + else + { + Standard_Real delta = (u2-u1)/nb; + for(int i=0; iValue(u); + netgen::Point3d pi(p.X(), p.Y(), p.Z()); + mesh.RestrictLocalH(pi, size); + double resultSize = mesh.GetH(pi); + if ( resultSize - size > 0.1*size ) + // netgen does restriction iff oldH/newH > 1.2 (localh.cpp:136) + mesh.RestrictLocalH(pi, resultSize/1.201); + } } }