From 1d5a7c2d7663835b5a59f5e2bfcdda3310f4af54 Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 19 Apr 2012 14:43:20 +0000 Subject: [PATCH] Regression of SMESH_TEST/Grids/smesh/mesh_Quadratic/B6 fix GetFaceNormal() for quadratic volumes --- src/SMDS/SMDS_VolumeTool.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/SMDS/SMDS_VolumeTool.cxx b/src/SMDS/SMDS_VolumeTool.cxx index eb8443aae..841d23540 100644 --- a/src/SMDS/SMDS_VolumeTool.cxx +++ b/src/SMDS/SMDS_VolumeTool.cxx @@ -1017,16 +1017,16 @@ bool SMDS_VolumeTool::GetFaceNormal (int faceIndex, double & X, double & Y, doub if ( !setFace( faceIndex )) return false; - XYZ p1 ( myFaceNodes[0] ); - XYZ p2 ( myFaceNodes[1] ); - XYZ p3 ( myFaceNodes[2] ); + const int iQuad = ( myFaceNbNodes > 6 && !myPolyedre ) ? 2 : 1; + XYZ p1 ( myFaceNodes[0*iQuad] ); + XYZ p2 ( myFaceNodes[1*iQuad] ); + XYZ p3 ( myFaceNodes[2*iQuad] ); XYZ aVec12( p2 - p1 ); XYZ aVec13( p3 - p1 ); XYZ cross = aVec12.Crossed( aVec13 ); - //if ( myFaceNbNodes == 4 ) { - if ( myFaceNbNodes >3 ) { - XYZ p4 ( myFaceNodes[3] ); + if ( myFaceNbNodes >3*iQuad ) { + XYZ p4 ( myFaceNodes[3*iQuad] ); XYZ aVec14( p4 - p1 ); XYZ cross2 = aVec13.Crossed( aVec14 ); cross = cross + cross2; -- 2.39.2