From 083e873dfe0759311086494f492597f0349b68e5 Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 31 May 2013 11:56:32 +0000 Subject: [PATCH] check orientation when re-loading points from a proxy mesh --- src/StdMeshers/StdMeshers_FaceSide.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/StdMeshers/StdMeshers_FaceSide.cxx b/src/StdMeshers/StdMeshers_FaceSide.cxx index 4d72e2f68..d83208167 100644 --- a/src/StdMeshers/StdMeshers_FaceSide.cxx +++ b/src/StdMeshers/StdMeshers_FaceSide.cxx @@ -358,13 +358,18 @@ const vector& StdMeshers_FaceSide::GetUVPtStruct(bool isXConst, { const UVPtStructVec& edgeUVPtStruct = proxySubMesh[iE]->GetUVPtStructVec(); std::copy( edgeUVPtStruct.begin(), edgeUVPtStruct.end(), & points[iPt] ); + // check orientation + double du1 = edgeUVPtStruct.back().param - edgeUVPtStruct[0].param; + double du2 = myLast[iE] - myFirst[iE]; + if ( du1 * du2 < 0 ) + std::reverse( & points[iPt], & points[iPt + edgeUVPtStruct.size()]); // update normalized params if ( myEdge.size() > 1 ) { for ( size_t i = 0; i < edgeUVPtStruct.size(); ++i, ++iPt ) { UVPtStruct & uvPt = points[iPt]; - uvPt.normParam = prevNormPar + uvPt.normParam * paramSize; - uvPt.x = uvPt.y = uvPt.normParam; + uvPt.normParam = prevNormPar + uvPt.normParam * paramSize; + uvPt.x = uvPt.y = uvPt.normParam; } --iPt; // to point to the 1st VERTEX of the next EDGE } -- 2.39.2