From: eap Date: Thu, 6 Mar 2014 12:18:18 +0000 (+0400) Subject: 22499: [CEA 1067] Porting to MeshGems 1.2-3 results in Error: OCC exception. Standard... X-Git-Tag: V7_4_0a1~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c11c738491642a45b5c4e4700964fd989bc6594b;p=plugins%2Fblsurfplugin.git 22499: [CEA 1067] Porting to MeshGems 1.2-3 results in Error: OCC exception. Standard_NullObject --- diff --git a/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx b/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx index d7cd386..4e3e8bf 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx @@ -1615,7 +1615,7 @@ namespace //================================================================================ /*! - * \brief Fills groups on nodes to be merged + * \brief Fills groups of nodes to be merged */ //================================================================================ @@ -3015,11 +3015,8 @@ bool BLSURFPlugin_BLSURF::compute(SMESH_Mesh& aMesh, SMESH_MeshEditor editor( &aMesh ); SMESH_MeshEditor::TListOfListOfNodes nodeGroupsToMerge; TIDSortedElemSet segementsOnEdge; - TIDSortedNodeSet nodesOnEdge; TSubMeshSet::iterator smIt; SMESHDS_SubMesh* smDS; - typedef SMDS_StdIterator< const SMDS_MeshNode*, SMDS_NodeIteratorPtr > TNodeIterator; - double tol; // merge nodes on EDGE's with ones computed by BLSURF for ( smIt = mergeSubmeshes.begin(); smIt != mergeSubmeshes.end(); ++smIt ) @@ -3140,6 +3137,12 @@ void BLSURFPlugin_BLSURF::Set_NodeOnEdge(SMESHDS_Mesh* meshDS, const SMDS_MeshNo Standard_Real p1 = 1.0; TopLoc_Location loc; Handle(Geom_Curve) curve = BRep_Tool::Curve(edge, loc, p0, p1); + if ( curve.IsNull() ) + { + // issue 22499. Node at a sphere apex + meshDS->SetNodeOnEdge(node, edge, p0); + return; + } if ( !loc.IsIdentity() ) pnt.Transform( loc.Transformation().Inverted() ); GeomAPI_ProjectPointOnCurve proj(pnt, curve, p0, p1); @@ -3158,9 +3161,6 @@ void BLSURFPlugin_BLSURF::Set_NodeOnEdge(SMESHDS_Mesh* meshDS, const SMDS_MeshNo meshDS->MoveNode( node, curve_pnt.X(), curve_pnt.Y(), curve_pnt.Z() ); } } -// GProp_GProps LProps; -// BRepGProp::LinearProperties(ed, LProps); -// double lg = (double)LProps.Mass(); meshDS->SetNodeOnEdge(node, edge, pa); }