TopExp::Vertices(theEdge, v1, v2);
const SMDS_MeshNode* n1 = VertexNode( v1, eSubMesh, 0 );
const SMDS_MeshNode* n2 = VertexNode( v2, eSubMesh, 0 );
+ const SMDS_MeshNode* nEnd[2] = { nbNodes ? theNodes.begin()->second : 0,
+ nbNodes ? theNodes.rbegin()->second : 0 };
Standard_Real f, l;
BRep_Tool::Range(theEdge, f, l);
if ( v1.Orientation() != TopAbs_FORWARD )
std::swap( f, l );
- if ( n1 && ++nbNodes )
+ if ( n1 && n1 != nEnd[0] && n1 != nEnd[1] && ++nbNodes )
theNodes.insert( make_pair( f, n1 ));
- if ( n2 && ++nbNodes )
+ if ( n2 && n2 != nEnd[0] && n2 != nEnd[1] && ++nbNodes )
theNodes.insert( make_pair( l, n2 ));
return (int)theNodes.size() == nbNodes;
}
// get nodes on theBaseEdge sorted by param on edge and initialize theParam2ColumnMap with them
+ const SMDS_MeshNode* prevEndNodes[2] = { 0, 0 };
edge = theBaseSide.begin();
for ( int iE = 0; edge != theBaseSide.end(); ++edge, ++iE )
{
const double prevPar = theParam2ColumnMap.empty() ? 0 : theParam2ColumnMap.rbegin()->first;
for ( u_n = sortedBaseNN.begin(); u_n != sortedBaseNN.end(); u_n++ )
{
+ if ( u_n->second == prevEndNodes[0] ||
+ u_n->second == prevEndNodes[1] )
+ continue;
double par = prevPar + coeff * ( u_n->first - f );
TParam2ColumnMap::iterator u2nn =
theParam2ColumnMap.insert( theParam2ColumnMap.end(), make_pair( par, TNodeColumn()));
u2nn->second.push_back( u_n->second );
}
+ prevEndNodes[0] = sortedBaseNN.begin()->second;
+ prevEndNodes[1] = sortedBaseNN.rbegin()->second;
}
if ( theParam2ColumnMap.size() < 2 )
return false;
StdMeshers_Quadrangle_2D quadAlgo( _gen->GetANewId(), GetStudyId(), _gen);
for ( int i = 0; i < 6; ++i )
{
- if ( !( quad[i] = FaceQuadStructPtr( quadAlgo.CheckNbEdges( aMesh, FF( i+1 )))))
+ if ( !( quad[i] = FaceQuadStructPtr( quadAlgo.CheckNbEdges( aMesh, FF( i+1 ),
+ /*considerMesh=*/true))))
return error( quadAlgo.GetComputeError() );
if ( quad[i]->side.size() != 4 )
return error( COMPERR_BAD_SHAPE, "Not a quadrangular box side" );