+ // compute distribution of radial nodes
+ list< double > params; // normalized params
+ static_cast< StdMeshers_QuadFromMedialAxis_1D2D::Algo1D* >
+ ( the1dAlgo )->ComputeDistribution( theHelper,
+ SMESH_TNodeXYZ( u2NPdist->second.first._node ),
+ SMESH_TNodeXYZ( u2NPdist->second.second._node ),
+ params );
+
+ // add a radial quad side
+ u2NP = thePointsOnEdges.begin();
+ const SMDS_MeshNode* nOut = u2NP->second.first._node;
+ const SMDS_MeshNode* nIn = u2NP->second.second._node;
+ nOut = proxyMesh->GetProxyNode( nOut );
+ nIn = proxyMesh->GetProxyNode( nIn );
+ gp_XY uvOut = theHelper.GetNodeUV( face, nOut );
+ gp_XY uvIn = theHelper.GetNodeUV( face, nIn );
+ Handle(Geom_Surface) surface = BRep_Tool::Surface( face );
+ UVPtStructVec uvsNew; UVPtStruct uvPt;
+ uvPt.node = nOut;
+ uvPt.u = uvOut.X();
+ uvPt.v = uvOut.Y();
+ uvsNew.push_back( uvPt );
+ for (list<double>::iterator itU = params.begin(); itU != params.end(); ++itU )
+ {
+ gp_XY uv = ( 1 - *itU ) * uvOut + *itU * uvIn;
+ gp_Pnt p = surface->Value( uv.X(), uv.Y() );
+ uvPt.node = theHelper.AddNode( p.X(), p.Y(), p.Z(), /*id=*/0, uv.X(), uv.Y() );
+ uvPt.u = uv.X();
+ uvPt.v = uv.Y();
+ uvsNew.push_back( uvPt );
+ }
+ uvPt.node = nIn;
+ uvPt.u = uvIn.X();
+ uvPt.v = uvIn.Y();
+ uvsNew.push_back( uvPt );
+
+ theFace._quad->side[ 0 ] = StdMeshers_FaceSide::New( uvsNew );
+ theFace._quad->side[ 2 ] = theFace._quad->side[ 0 ];
+
+ // rotate the IN side if opposite nodes of IN and OUT sides don't match
+ const SMDS_MeshNode * nIn0 = theFace._quad->side[ 1 ].First().node;
+ if ( nIn0 != nIn )
+ {
+ nIn = proxyMesh->GetProxyNode( nIn );
+ const UVPtStructVec& uvsIn = theFace._quad->side[ 1 ].GetUVPtStruct(); // _sinuSide[1]
+ size_t i; // find UVPtStruct holding nIn
+ for ( i = 0; i < uvsIn.size(); ++i )
+ if ( nIn == uvsIn[i].node )
+ break;
+ if ( i == uvsIn.size() )
+ return false;
+
+ // create a new IN quad side
+ uvsNew.clear();
+ uvsNew.reserve( uvsIn.size() );
+ uvsNew.insert( uvsNew.end(), uvsIn.begin() + i, uvsIn.end() );
+ uvsNew.insert( uvsNew.end(), uvsIn.begin() + 1, uvsIn.begin() + i + 1);
+ theFace._quad->side[ 1 ] = StdMeshers_FaceSide::New( uvsNew );
+ }
+ } // if ( theShortEdges[0].empty() )
+
+ return true;
+
+ } // setQuadSides()