mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-27 13:10:34 +05:00
20974: EDF 1551 GEOM: Extra edges appear in the result of a partition and can't be removed
Optimize smooth: 3 loops in 2D and 2 loops in 3D
This commit is contained in:
parent
ccb0d68b6f
commit
50c2fb07ab
@ -3376,6 +3376,12 @@ void StdMeshers_Quadrangle_2D::smooth (FaceQuadStruct::Ptr quad)
|
||||
if ( sNode._triangles.empty() )
|
||||
continue; // not movable node
|
||||
|
||||
gp_XY newUV;
|
||||
bool isValid = false;
|
||||
bool use3D = ( iLoop > 2 ); // 3 loops in 2D and 2, in 3D
|
||||
|
||||
if ( use3D )
|
||||
{
|
||||
// compute a new XYZ
|
||||
gp_XYZ newXYZ (0,0,0);
|
||||
for ( unsigned i = 0; i < sNode._triangles.size(); ++i )
|
||||
@ -3383,9 +3389,8 @@ void StdMeshers_Quadrangle_2D::smooth (FaceQuadStruct::Ptr quad)
|
||||
newXYZ /= sNode._triangles.size();
|
||||
|
||||
// compute a new UV by projection
|
||||
gp_XY newUV;
|
||||
proj.Perform( newXYZ );
|
||||
bool isValid = ( proj.IsDone() && proj.NbPoints() > 0 );
|
||||
isValid = ( proj.IsDone() && proj.NbPoints() > 0 );
|
||||
if ( isValid )
|
||||
{
|
||||
// check validity of the newUV
|
||||
@ -3395,6 +3400,7 @@ void StdMeshers_Quadrangle_2D::smooth (FaceQuadStruct::Ptr quad)
|
||||
for ( unsigned i = 0; i < sNode._triangles.size() && isValid; ++i )
|
||||
isValid = ( sNode._triangles[i].IsForward( newUV ) == refForward );
|
||||
}
|
||||
}
|
||||
if ( !isValid )
|
||||
{
|
||||
// compute a new UV by averaging
|
||||
|
Loading…
Reference in New Issue
Block a user