mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-04-02 04:34:28 +05:00
Fix regression of doc/salome/examples/prism_3d_algo.py
This commit is contained in:
parent
d92118a7a5
commit
86ca561170
@ -280,7 +280,7 @@ namespace SMESH
|
|||||||
void ModifiedMesh (_PTR(SObject) theSObject, bool theIsNotModif, bool isEmptyMesh)
|
void ModifiedMesh (_PTR(SObject) theSObject, bool theIsNotModif, bool isEmptyMesh)
|
||||||
{
|
{
|
||||||
_PTR(Study) aStudy = GetActiveStudyDocument();
|
_PTR(Study) aStudy = GetActiveStudyDocument();
|
||||||
if (aStudy->GetProperties()->IsLocked())
|
if ( !aStudy || aStudy->GetProperties()->IsLocked() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
|
_PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
|
||||||
|
@ -193,22 +193,23 @@ const BRepMesh_Triangle* SMESH_Delaunay::FindTriangle( const gp_XY&
|
|||||||
nodeUVs[1] = _triaDS->GetNode( nodeIDs[1] ).Coord();
|
nodeUVs[1] = _triaDS->GetNode( nodeIDs[1] ).Coord();
|
||||||
nodeUVs[2] = _triaDS->GetNode( nodeIDs[2] ).Coord();
|
nodeUVs[2] = _triaDS->GetNode( nodeIDs[2] ).Coord();
|
||||||
|
|
||||||
if ( _triaDS->GetNode( nodeIDs[0] ).Movability() == BRepMesh_Frontier &&
|
|
||||||
_triaDS->GetNode( nodeIDs[1] ).Movability() == BRepMesh_Frontier &&
|
|
||||||
_triaDS->GetNode( nodeIDs[2] ).Movability() == BRepMesh_Frontier )
|
|
||||||
{
|
|
||||||
SMESH_MeshAlgos::GetBarycentricCoords( uv,
|
SMESH_MeshAlgos::GetBarycentricCoords( uv,
|
||||||
nodeUVs[0], nodeUVs[1], nodeUVs[2],
|
nodeUVs[0], nodeUVs[1], nodeUVs[2],
|
||||||
bc[0], bc[1] );
|
bc[0], bc[1] );
|
||||||
if ( bc[0] >= 0 && bc[1] >= 0 && bc[0] + bc[1] <= 1 )
|
if ( bc[0] >= 0 && bc[1] >= 0 && bc[0] + bc[1] <= 1 )
|
||||||
{
|
{
|
||||||
|
if ( _triaDS->GetNode( nodeIDs[0] ).Movability() != BRepMesh_Frontier ||
|
||||||
|
_triaDS->GetNode( nodeIDs[1] ).Movability() != BRepMesh_Frontier ||
|
||||||
|
_triaDS->GetNode( nodeIDs[2] ).Movability() != BRepMesh_Frontier )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
bc[2] = 1 - bc[0] - bc[1];
|
bc[2] = 1 - bc[0] - bc[1];
|
||||||
triaNodes[0] = nodeIDs[0] - 1;
|
triaNodes[0] = nodeIDs[0] - 1;
|
||||||
triaNodes[1] = nodeIDs[1] - 1;
|
triaNodes[1] = nodeIDs[1] - 1;
|
||||||
triaNodes[2] = nodeIDs[2] - 1;
|
triaNodes[2] = nodeIDs[2] - 1;
|
||||||
return tria;
|
return tria;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// look for a neighbor triangle, which is adjacent to a link intersected
|
// look for a neighbor triangle, which is adjacent to a link intersected
|
||||||
// by a segment( triangle center -> uv )
|
// by a segment( triangle center -> uv )
|
||||||
|
@ -1200,8 +1200,8 @@ bool StdMeshers_Prism_3D::compute(const Prism_3D::TPrismTopo& thePrism)
|
|||||||
sweeper.myBndColumns.push_back( & u2colIt->second );
|
sweeper.myBndColumns.push_back( & u2colIt->second );
|
||||||
}
|
}
|
||||||
// load node columns inside the bottom FACE
|
// load node columns inside the bottom FACE
|
||||||
TNode2ColumnMap::iterator bot_column = myBotToColumnMap.begin();
|
|
||||||
sweeper.myIntColumns.reserve( myBotToColumnMap.size() );
|
sweeper.myIntColumns.reserve( myBotToColumnMap.size() );
|
||||||
|
TNode2ColumnMap::iterator bot_column = myBotToColumnMap.begin();
|
||||||
for ( ; bot_column != myBotToColumnMap.end(); ++bot_column )
|
for ( ; bot_column != myBotToColumnMap.end(); ++bot_column )
|
||||||
sweeper.myIntColumns.push_back( & bot_column->second );
|
sweeper.myIntColumns.push_back( & bot_column->second );
|
||||||
|
|
||||||
@ -1242,6 +1242,14 @@ bool StdMeshers_Prism_3D::compute(const Prism_3D::TPrismTopo& thePrism)
|
|||||||
// column nodes; middle part of the column are zero pointers
|
// column nodes; middle part of the column are zero pointers
|
||||||
TNodeColumn& column = bot_column->second;
|
TNodeColumn& column = bot_column->second;
|
||||||
|
|
||||||
|
// check if a column is already computed using non-block approach
|
||||||
|
size_t i;
|
||||||
|
for ( i = 0; i < column.size(); ++i )
|
||||||
|
if ( !column[ i ])
|
||||||
|
break;
|
||||||
|
if ( i == column.size() )
|
||||||
|
continue; // all nodes created
|
||||||
|
|
||||||
gp_XYZ botParams, topParams;
|
gp_XYZ botParams, topParams;
|
||||||
if ( !tBotNode.HasParams() )
|
if ( !tBotNode.HasParams() )
|
||||||
{
|
{
|
||||||
@ -2282,7 +2290,7 @@ bool StdMeshers_Prism_3D::assocOrProjBottom2Top( const gp_Trsf & bottomToTopTrsf
|
|||||||
TNode2ColumnMap::iterator bN_col =
|
TNode2ColumnMap::iterator bN_col =
|
||||||
myBotToColumnMap.insert( make_pair ( bN, TNodeColumn() )).first;
|
myBotToColumnMap.insert( make_pair ( bN, TNodeColumn() )).first;
|
||||||
TNodeColumn & column = bN_col->second;
|
TNodeColumn & column = bN_col->second;
|
||||||
column.resize( zSize );
|
column.resize( zSize, 0 );
|
||||||
column.front() = botNode;
|
column.front() = botNode;
|
||||||
column.back() = topNode;
|
column.back() = topNode;
|
||||||
}
|
}
|
||||||
@ -4962,8 +4970,7 @@ bool StdMeshers_Sweeper::ComputeNodesByTrsf( const double tol,
|
|||||||
|
|
||||||
// for each internal column find boundary nodes whose error to use for correction
|
// for each internal column find boundary nodes whose error to use for correction
|
||||||
prepareTopBotDelaunay();
|
prepareTopBotDelaunay();
|
||||||
if ( !findDelaunayTriangles())
|
bool isErrorCorrectable = findDelaunayTriangles();
|
||||||
return false;
|
|
||||||
|
|
||||||
// compute coordinates of internal nodes by projecting (transfroming) src and tgt
|
// compute coordinates of internal nodes by projecting (transfroming) src and tgt
|
||||||
// nodes towards the central layer
|
// nodes towards the central layer
|
||||||
@ -5021,6 +5028,22 @@ bool StdMeshers_Sweeper::ComputeNodesByTrsf( const double tol,
|
|||||||
fromSrcBndPnts.swap( toSrcBndPnts );
|
fromSrcBndPnts.swap( toSrcBndPnts );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Evaluate an error of boundary points
|
||||||
|
|
||||||
|
if ( !isErrorCorrectable && !allowHighBndError )
|
||||||
|
{
|
||||||
|
for ( size_t iP = 0; iP < myBndColumns.size(); ++iP )
|
||||||
|
{
|
||||||
|
double sumError = 0;
|
||||||
|
for ( size_t z = 1; z < zS; ++z ) // loop on layers
|
||||||
|
sumError += ( bndError[ z-1 ][ iP ].Modulus() +
|
||||||
|
bndError[ zSize-z ][ iP ].Modulus() );
|
||||||
|
|
||||||
|
if ( sumError > tol )
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Compute two projections of internal points to the central layer
|
// Compute two projections of internal points to the central layer
|
||||||
// in order to evaluate an error of internal points
|
// in order to evaluate an error of internal points
|
||||||
|
|
||||||
@ -5080,7 +5103,6 @@ bool StdMeshers_Sweeper::ComputeNodesByTrsf( const double tol,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//centerIntErrorIsSmall = true; // 3D_mesh_Extrusion_00/A3
|
|
||||||
if ( !centerIntErrorIsSmall )
|
if ( !centerIntErrorIsSmall )
|
||||||
{
|
{
|
||||||
// Compensate the central error; continue adding projection
|
// Compensate the central error; continue adding projection
|
||||||
@ -5289,7 +5311,7 @@ bool StdMeshers_Sweeper::ComputeNodesOnStraight()
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// create nodes along a line
|
// create nodes along a line
|
||||||
SMESH_NodeXYZ botP( botNode ), topP( topNode);
|
SMESH_NodeXYZ botP( botNode ), topP( topNode );
|
||||||
for ( size_t iZ = 0; iZ < myZColumns[0].size(); ++iZ )
|
for ( size_t iZ = 0; iZ < myZColumns[0].size(); ++iZ )
|
||||||
{
|
{
|
||||||
// use barycentric coordinates as weight of Z of boundary columns
|
// use barycentric coordinates as weight of Z of boundary columns
|
||||||
@ -5426,7 +5448,10 @@ bool StdMeshers_Sweeper::findDelaunayTriangles()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( myBotDelaunay->NbVisitedNodes() < nbInternalNodes )
|
if ( myBotDelaunay->NbVisitedNodes() < nbInternalNodes )
|
||||||
|
{
|
||||||
|
myTopBotTriangles.clear();
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
myBotDelaunay.reset();
|
myBotDelaunay.reset();
|
||||||
myTopDelaunay.reset();
|
myTopDelaunay.reset();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user