From d30b889d6084ff7d9e08749ecbf659a0cf5aaecc Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 14 Nov 2013 10:26:03 +0000 Subject: [PATCH] 22401: [CEA 992] Regression on SMESH using NETGEN 2D Ignore degenerated segments when setting local h --- src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cxx index d77435c..ac4cf49 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cxx @@ -301,7 +301,10 @@ bool NETGENPlugin_NETGEN_2D_ONLY::Compute(SMESH_Mesh& aMesh, TopExp::MapShapes( aMesh.GetShapeToMesh(), TopAbs_EDGE, edgeMap ); for ( int iE = 1; iE <= edgeMap.Extent(); ++iE ) { - SMESHDS_SubMesh* smDS = aMesh.GetMeshDS()->MeshElements( edgeMap( iE )); + const TopoDS_Shape& edge = edgeMap( iE ); + if ( SMESH_Algo::isDegenerated( TopoDS::Edge( edge ))) + continue; + SMESHDS_SubMesh* smDS = aMesh.GetMeshDS()->MeshElements( edge ); if ( !smDS ) continue; SMDS_ElemIteratorPtr segIt = smDS->GetElements(); while ( segIt->more() ) @@ -311,7 +314,7 @@ bool NETGENPlugin_NETGEN_2D_ONLY::Compute(SMESH_Mesh& aMesh, SMESH_TNodeXYZ n2 = seg->GetNode(1); gp_XYZ p = 0.5 * ( n1 + n2 ); netgen::Point3d pi(p.X(), p.Y(), p.Z()); - ngMesh->RestrictLocalH( pi, ( n1 - n2 ).Modulus() ); + ngMesh->RestrictLocalH( pi, Max(( n1 - n2 ).Modulus(), netgen::mparam.minh )); } } -- 2.39.2