diff --git a/Operation.cpp b/Operation.cpp index 3a4e10e..c3848ab 100644 --- a/Operation.cpp +++ b/Operation.cpp @@ -652,8 +652,12 @@ Operation::GetDistanceFromRawSide( int nPhase, const Point3d& ptP, const Vector3 IntersCurveCurve intCC( *pRay, *pOut) ; int nInters = intCC.GetIntersCount() ; IntCrvCrvInfo aInfo ; - if ( nInters > 0 && intCC.GetIntCrvCrvInfo( nInters - 1, aInfo)) - dDist = aInfo.IciA[0].dU * RAY_LEN - EXTRA_LEN ; + if ( nInters > 0 && intCC.GetIntCrvCrvInfo( nInters - 1, aInfo)) { + if ( ! aInfo.bOverlap) + dDist = aInfo.IciA[0].dU * RAY_LEN - EXTRA_LEN ; + else + dDist = aInfo.IciA[1].dU * RAY_LEN - EXTRA_LEN ; + } else dDist = 0 ; return true ;