check orientation when re-loading points from a proxy mesh

This commit is contained in:
eap 2013-05-31 11:56:32 +00:00
parent 3c2cd16c45
commit 083e873dfe

View File

@ -358,6 +358,11 @@ const vector<UVPtStruct>& 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 )