+ // evaluate distance to neighbor projections
+ const double rShort = 0.2;
+ bool isShortPrev[2], isShortNext[2];
+ map< double, pair< NodePoint, NodePoint > >::iterator u2NPPrev = u2NP, u2NPNext = u2NP;
+ --u2NPPrev; ++u2NPNext;
+ bool hasPrev = ( u2NP != thePointsOnE.begin() );
+ bool hasNext = ( u2NPNext != thePointsOnE.end() );
+ if ( !hasPrev ) u2NPPrev = u2NP0;
+ if ( !hasNext ) u2NPNext = u2NP1;
+ for ( int iS = 0; iS < 2; ++iS ) // side with Vertex and side with Nodes
+ {
+ NodePoint np = get( u2NP->second, iS );
+ NodePoint npPrev = get( u2NPPrev->second, iS );
+ NodePoint npNext = get( u2NPNext->second, iS );
+ gp_Pnt p = np .Point( theCurves );
+ gp_Pnt pPrev = npPrev.Point( theCurves );
+ gp_Pnt pNext = npNext.Point( theCurves );
+ double distPrev = p.Distance( pPrev );
+ double distNext = p.Distance( pNext );
+ double r = distPrev / ( distPrev + distNext );
+ isShortPrev[iS] = ( r < rShort );
+ isShortNext[iS] = (( 1 - r ) > ( 1 - rShort ));
+ }
+ // if ( !hasPrev ) isShortPrev[0] = isShortPrev[1] = false;
+ // if ( !hasNext ) isShortNext[0] = isShortNext[1] = false;
+
+ map< double, pair< NodePoint, NodePoint > >::iterator u2NPClose;