mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-15 05:00:32 +05:00
Fix smoothing quadratic elements on non planar surfaces.
This commit is contained in:
parent
ae30e9e9e0
commit
c86911a843
@ -2398,6 +2398,9 @@ void SMESH_MeshEditor::Smooth (set<const SMDS_MeshElement*> & theElems,
|
|||||||
// move medium nodes of quadratic elements
|
// move medium nodes of quadratic elements
|
||||||
if ( isQuadratic )
|
if ( isQuadratic )
|
||||||
{
|
{
|
||||||
|
SMESH_MesherHelper helper( *GetMesh() );
|
||||||
|
if ( !face.IsNull() )
|
||||||
|
helper.SetSubShape( face );
|
||||||
list< const SMDS_MeshElement* >::iterator elemIt = elemsOnFace.begin();
|
list< const SMDS_MeshElement* >::iterator elemIt = elemsOnFace.begin();
|
||||||
for ( ; elemIt != elemsOnFace.end(); ++elemIt ) {
|
for ( ; elemIt != elemsOnFace.end(); ++elemIt ) {
|
||||||
const SMDS_QuadraticFaceOfNodes* QF =
|
const SMDS_QuadraticFaceOfNodes* QF =
|
||||||
@ -2409,10 +2412,20 @@ void SMESH_MeshEditor::Smooth (set<const SMDS_MeshElement*> & theElems,
|
|||||||
while ( anIter->more() )
|
while ( anIter->more() )
|
||||||
Ns.push_back( anIter->next() );
|
Ns.push_back( anIter->next() );
|
||||||
Ns.push_back( Ns[0] );
|
Ns.push_back( Ns[0] );
|
||||||
for(int i=0; i<QF->NbNodes(); i=i+2) {
|
double x, y, z;
|
||||||
double x = (Ns[i]->X() + Ns[i+2]->X())/2;
|
for ( int i=0; i<QF->NbNodes(); i=i+2 ) {
|
||||||
double y = (Ns[i]->Y() + Ns[i+2]->Y())/2;
|
if ( !surface.IsNull() ) {
|
||||||
double z = (Ns[i]->Z() + Ns[i+2]->Z())/2;
|
gp_XY uv1 = helper.GetNodeUV( face, Ns[i], Ns[i+2] );
|
||||||
|
gp_XY uv2 = helper.GetNodeUV( face, Ns[i+2], Ns[i] );
|
||||||
|
gp_XY uv = ( uv1 + uv2 ) / 2.;
|
||||||
|
gp_Pnt xyz = surface->Value( uv.X(), uv.Y() );
|
||||||
|
x = xyz.X(); y = xyz.Y(); z = xyz.Z();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
x = (Ns[i]->X() + Ns[i+2]->X())/2;
|
||||||
|
y = (Ns[i]->Y() + Ns[i+2]->Y())/2;
|
||||||
|
z = (Ns[i]->Z() + Ns[i+2]->Z())/2;
|
||||||
|
}
|
||||||
if( fabs( Ns[i+1]->X() - x ) > disttol ||
|
if( fabs( Ns[i+1]->X() - x ) > disttol ||
|
||||||
fabs( Ns[i+1]->Y() - y ) > disttol ||
|
fabs( Ns[i+1]->Y() - y ) > disttol ||
|
||||||
fabs( Ns[i+1]->Z() - z ) > disttol ) {
|
fabs( Ns[i+1]->Z() - z ) > disttol ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user