From 1dee10aec7ccc0ccb02d1593891725f7223e9bdb Mon Sep 17 00:00:00 2001 From: eap Date: Mon, 30 May 2011 09:38:54 +0000 Subject: [PATCH] fix face orientation in projectPartner() if project from the equal face --- src/StdMeshers/StdMeshers_Projection_2D.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/StdMeshers/StdMeshers_Projection_2D.cxx b/src/StdMeshers/StdMeshers_Projection_2D.cxx index a61d64a0e..52e9ef7eb 100644 --- a/src/StdMeshers/StdMeshers_Projection_2D.cxx +++ b/src/StdMeshers/StdMeshers_Projection_2D.cxx @@ -531,6 +531,11 @@ namespace { const SMDS_MeshNode* nullNode = 0; + // indices of nodes to create properly oriented faces + int tri1 = 1, tri2 = 2, quad1 = 1, quad3 = 3; + if ( trsf.Form() != gp_Identity ) + std::swap( tri1, tri2 ), std::swap( quad1, quad3 ); + SMESHDS_SubMesh* srcSubDS = srcMesh->GetMeshDS()->MeshElements( srcFace ); SMDS_ElemIteratorPtr elemIt = srcSubDS->GetElements(); vector< const SMDS_MeshNode* > tgtNodes; @@ -556,11 +561,11 @@ namespace { } tgtNodes[i] = srcN_tgtN->second; } - // create a new face (with reversed orientation) + // create a new face switch ( nbN ) { - case 3: helper.AddFace(tgtNodes[0], tgtNodes[2], tgtNodes[1]); break; - case 4: helper.AddFace(tgtNodes[0], tgtNodes[3], tgtNodes[2], tgtNodes[1]); break; + case 3: helper.AddFace(tgtNodes[0], tgtNodes[tri1], tgtNodes[tri2]); break; + case 4: helper.AddFace(tgtNodes[0], tgtNodes[quad1], tgtNodes[2], tgtNodes[quad3]); break; } } return true; -- 2.39.2