From d9297961f700975795094f9932d65cc0f49a1abf Mon Sep 17 00:00:00 2001 From: eap Date: Mon, 12 Dec 2011 11:00:48 +0000 Subject: [PATCH] 0021440: EDF 2040 SMESH: Bug translation of a mesh GetMediumNode(): use Force3D=true if projection on EDGE fails --- src/SMESH/SMESH_MesherHelper.cxx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/SMESH/SMESH_MesherHelper.cxx b/src/SMESH/SMESH_MesherHelper.cxx index 34cef148d..b5d410807 100644 --- a/src/SMESH/SMESH_MesherHelper.cxx +++ b/src/SMESH/SMESH_MesherHelper.cxx @@ -1015,24 +1015,27 @@ const SMDS_MeshNode* SMESH_MesherHelper::GetMediumNode(const SMDS_MeshNode* n1, } else if ( pos.second == TopAbs_EDGE ) { - if ( n1->GetPosition()->GetTypeOfPosition()==SMDS_TOP_EDGE && - n2->GetPosition()->GetTypeOfPosition()==SMDS_TOP_EDGE && + const SMDS_PositionPtr Pos1 = n1->GetPosition(); + const SMDS_PositionPtr Pos2 = n2->GetPosition(); + if ( Pos1->GetTypeOfPosition()==SMDS_TOP_EDGE && + Pos2->GetTypeOfPosition()==SMDS_TOP_EDGE && n1->getshapeId() != n2->getshapeId() ) + { // issue 0021006 return getMediumNodeOnComposedWire(n1,n2,force3d); - + } E = TopoDS::Edge(meshDS->IndexToShape( edgeID = pos.first )); u[0] = GetNodeU(E,n1,n2, force3d ? 0 : &uvOK[0]); u[1] = GetNodeU(E,n2,n1, force3d ? 0 : &uvOK[1]); } - if(!force3d) + if ( !force3d & uvOK[0] && uvOK[1] ) { // we try to create medium node using UV parameters of // nodes, else - medium between corresponding 3d points if( ! F.IsNull() ) { - if ( uvOK[0] && uvOK[1] ) + //if ( uvOK[0] && uvOK[1] ) { if ( IsDegenShape( n1->getshapeId() )) { if ( myParIndex & U_periodic ) uv[0].SetCoord( 1, uv[1].Coord( 1 )); -- 2.39.2