mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-30 22:40:33 +05:00
PAL9163. Fix GetFaceNormal() for badly shaped quadrangles
This commit is contained in:
parent
030274bd88
commit
55a05c00fe
@ -471,6 +471,15 @@ bool SMDS_VolumeTool::GetFaceNormal (int faceIndex, double & X, double & Y, doub
|
||||
XYZ aVec13( p3 - p1 );
|
||||
XYZ cross = aVec12.Crossed( aVec13 );
|
||||
|
||||
if ( myFaceNbNodes[ faceIndex ] == 4 ) {
|
||||
XYZ p4 ( myFaceNodes[3] );
|
||||
XYZ aVec14( p4 - p1 );
|
||||
XYZ cross2 = aVec13.Crossed( aVec14 );
|
||||
cross.x += cross2.x;
|
||||
cross.y += cross2.y;
|
||||
cross.z += cross2.z;
|
||||
}
|
||||
|
||||
double size = cross.Magnitude();
|
||||
if ( size <= DBL_MIN )
|
||||
return false;
|
||||
@ -802,8 +811,9 @@ bool SMDS_VolumeTool::setFace( int faceIndex )
|
||||
|
||||
// set face nodes
|
||||
int iNode, nbNode = myFaceNbNodes[ faceIndex ];
|
||||
for ( iNode = 0; iNode <= nbNode; iNode++ )
|
||||
for ( iNode = 0; iNode < nbNode; iNode++ )
|
||||
myFaceNodes[ iNode ] = myVolumeNodes[ myFaceNodeIndices[ iNode ]];
|
||||
myFaceNodes[ iNode ] = myFaceNodes[ 0 ];
|
||||
|
||||
myCurFace = faceIndex;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user