mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-29 19:00:35 +05:00
0022166: [CEA 792] Regression on 07_Pentahedron.py, 12_3d_extrusion.py
and 13_projection_3d.py scripts from CEA test base Set implicitly created nodes (medium and central ones) to shape independently of mySetElemOnShape
This commit is contained in:
parent
e64b615389
commit
b5f12761af
@ -513,6 +513,7 @@ gp_XY SMESH_MesherHelper::GetNodeUV(const TopoDS_Face& F,
|
||||
bool* check) const
|
||||
{
|
||||
gp_Pnt2d uv( Precision::Infinite(), Precision::Infinite() );
|
||||
|
||||
const SMDS_PositionPtr Pos = n->GetPosition();
|
||||
bool uvOK = false;
|
||||
if(Pos->GetTypeOfPosition()==SMDS_TOP_FACE)
|
||||
@ -797,7 +798,8 @@ double SMESH_MesherHelper::GetNodeU(const TopoDS_Edge& E,
|
||||
const SMDS_MeshNode* inEdgeNode,
|
||||
bool* check)
|
||||
{
|
||||
double param = 0;
|
||||
double param = Precision::Infinite();
|
||||
|
||||
const SMDS_PositionPtr pos = n->GetPosition();
|
||||
if ( pos->GetTypeOfPosition()==SMDS_TOP_EDGE )
|
||||
{
|
||||
@ -1134,7 +1136,7 @@ const SMDS_MeshNode* SMESH_MesherHelper::GetCentralNode(const SMDS_MeshNode* n1,
|
||||
Handle( Geom_Surface ) S = BRep_Tool::Surface( F, loc );
|
||||
P = S->Value( uvAvg.X(), uvAvg.Y() ).Transformed( loc );
|
||||
centralNode = meshDS->AddNode( P.X(), P.Y(), P.Z() );
|
||||
if ( mySetElemOnShape )
|
||||
// if ( mySetElemOnShape ) node is not elem!
|
||||
meshDS->SetNodeOnFace( centralNode, faceID, uvAvg.X(), uvAvg.Y() );
|
||||
myMapWithCentralNode.insert( std::make_pair( keyOfMap, centralNode ) );
|
||||
return centralNode;
|
||||
@ -1147,8 +1149,6 @@ const SMDS_MeshNode* SMESH_MesherHelper::GetCentralNode(const SMDS_MeshNode* n1,
|
||||
SMESH_TNodeXYZ( n4 ) ) / 4;
|
||||
centralNode = meshDS->AddNode( P.X(), P.Y(), P.Z() );
|
||||
|
||||
if ( mySetElemOnShape )
|
||||
{
|
||||
if ( !F.IsNull() )
|
||||
{
|
||||
uvAvg = (GetNodeUV(F,n1,n3) +
|
||||
@ -1159,11 +1159,13 @@ const SMDS_MeshNode* SMESH_MesherHelper::GetCentralNode(const SMDS_MeshNode* n1,
|
||||
meshDS->SetNodeOnFace( centralNode, faceID, uvAvg.X(), uvAvg.Y() );
|
||||
}
|
||||
else if ( shapeID > 0 )
|
||||
{
|
||||
meshDS->SetNodeInVolume( centralNode, shapeID );
|
||||
else if ( myShapeID > 0 )
|
||||
}
|
||||
else if ( myShapeID > 0 && mySetElemOnShape )
|
||||
{
|
||||
meshDS->SetMeshElementOnShape( centralNode, myShapeID );
|
||||
}
|
||||
|
||||
myMapWithCentralNode.insert( std::make_pair( keyOfMap, centralNode ) );
|
||||
return centralNode;
|
||||
}
|
||||
@ -1247,7 +1249,7 @@ const SMDS_MeshNode* SMESH_MesherHelper::GetMediumNode(const SMDS_MeshNode* n1,
|
||||
gp_XY UV = GetMiddleUV( S, uv[0], uv[1] );
|
||||
gp_Pnt P = S->Value( UV.X(), UV.Y() ).Transformed(loc);
|
||||
n12 = meshDS->AddNode(P.X(), P.Y(), P.Z());
|
||||
if ( mySetElemOnShape )
|
||||
// if ( mySetElemOnShape ) node is not elem!
|
||||
meshDS->SetNodeOnFace(n12, faceID, UV.X(), UV.Y());
|
||||
myTLinkNodeMap.insert(make_pair(link,n12));
|
||||
return n12;
|
||||
@ -1272,7 +1274,7 @@ const SMDS_MeshNode* SMESH_MesherHelper::GetMediumNode(const SMDS_MeshNode* n1,
|
||||
|
||||
gp_Pnt P = C->Value( U );
|
||||
n12 = meshDS->AddNode(P.X(), P.Y(), P.Z());
|
||||
if ( mySetElemOnShape )
|
||||
//if ( mySetElemOnShape ) node is not elem!
|
||||
meshDS->SetNodeOnEdge(n12, edgeID, U);
|
||||
myTLinkNodeMap.insert(make_pair(link,n12));
|
||||
return n12;
|
||||
@ -1286,21 +1288,21 @@ const SMDS_MeshNode* SMESH_MesherHelper::GetMediumNode(const SMDS_MeshNode* n1,
|
||||
double z = ( n1->Z() + n2->Z() )/2.;
|
||||
n12 = meshDS->AddNode(x,y,z);
|
||||
|
||||
if ( mySetElemOnShape )
|
||||
//if ( mySetElemOnShape ) node is not elem!
|
||||
{
|
||||
if ( !F.IsNull() )
|
||||
{
|
||||
gp_XY UV = ( uv[0] + uv[1] ) / 2.;
|
||||
CheckNodeUV( F, n12, UV, 2*BRep_Tool::Tolerance( F ), /*force=*/true);
|
||||
CheckNodeUV( F, n12, UV, 2 * BRep_Tool::Tolerance( F ), /*force=*/true);
|
||||
meshDS->SetNodeOnFace(n12, faceID, UV.X(), UV.Y() );
|
||||
}
|
||||
else if ( !E.IsNull() )
|
||||
{
|
||||
double U = ( u[0] + u[1] ) / 2.;
|
||||
CheckNodeU( E, n12, U, 2*BRep_Tool::Tolerance( E ), /*force=*/true);
|
||||
CheckNodeU( E, n12, U, 2 * BRep_Tool::Tolerance( E ), /*force=*/true);
|
||||
meshDS->SetNodeOnEdge(n12, edgeID, U);
|
||||
}
|
||||
else if ( myShapeID > 0 )
|
||||
else if ( myShapeID > 0 && mySetElemOnShape )
|
||||
{
|
||||
meshDS->SetMeshElementOnShape(n12, myShapeID);
|
||||
}
|
||||
@ -1375,7 +1377,7 @@ const SMDS_MeshNode* SMESH_MesherHelper::getMediumNodeOnComposedWire(const SMDS_
|
||||
GetMeshDS()->MoveNode( n12, p.X(), p.Y(), p.Z() );
|
||||
}
|
||||
|
||||
if ( mySetElemOnShape )
|
||||
//if ( mySetElemOnShape ) node is not elem!
|
||||
GetMeshDS()->SetNodeOnEdge(n12, edges[iOkEdge], u);
|
||||
|
||||
myTLinkNodeMap.insert( make_pair( SMESH_TLink(n1,n2), n12 ));
|
||||
@ -1397,7 +1399,7 @@ SMDS_MeshNode* SMESH_MesherHelper::AddNode(double x, double y, double z, int ID,
|
||||
node = meshDS->AddNodeWithID( x, y, z, ID );
|
||||
else
|
||||
node = meshDS->AddNode( x, y, z );
|
||||
if ( mySetElemOnShape && myShapeID > 0 ) {
|
||||
if ( mySetElemOnShape && myShapeID > 0 ) { // node is not elem ?
|
||||
switch ( myShape.ShapeType() ) {
|
||||
case TopAbs_SOLID: meshDS->SetNodeInVolume( node, myShapeID); break;
|
||||
case TopAbs_SHELL: meshDS->SetNodeInVolume( node, myShapeID); break;
|
||||
|
Loading…
Reference in New Issue
Block a user