From: eap Date: Tue, 7 Sep 2010 06:35:44 +0000 (+0000) Subject: use linked nodes to get an upward direction when defining orientation X-Git-Tag: V5_1_5a1~61 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b5eb9a6a034eb3818e8ce463178350cca0616e83;p=modules%2Fsmesh.git use linked nodes to get an upward direction when defining orientation --- diff --git a/src/SMDS/SMDS_VolumeTool.cxx b/src/SMDS/SMDS_VolumeTool.cxx index 52633d610..2967928a1 100644 --- a/src/SMDS/SMDS_VolumeTool.cxx +++ b/src/SMDS/SMDS_VolumeTool.cxx @@ -518,8 +518,10 @@ bool SMDS_VolumeTool::Set (const SMDS_MeshElement* theVolume) // define volume orientation XYZ botNormal; GetFaceNormal( 0, botNormal.x, botNormal.y, botNormal.z ); - const SMDS_MeshNode* topNode = myVolumeNodes[ myVolumeNbNodes - 1 ]; const SMDS_MeshNode* botNode = myVolumeNodes[ 0 ]; + int topNodeIndex = myVolume->NbCornerNodes() - 1; + while ( !IsLinked( 0, topNodeIndex )) --topNodeIndex; + const SMDS_MeshNode* topNode = myVolumeNodes[ topNodeIndex ]; XYZ upDir (topNode->X() - botNode->X(), topNode->Y() - botNode->Y(), topNode->Z() - botNode->Z() );