From d5638e192c41d222645dc97ed8914ebf6fca4be7 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 6 Nov 2023 11:10:41 +0100 Subject: [PATCH] =?UTF-8?q?EgtMachKernel=20:=20-=20corretta=20GetDistanceF?= =?UTF-8?q?romRawSide=20per=20sapere=20quanto=20una=20posizione=20=C3=A8?= =?UTF-8?q?=20all'interno=20del=20grezzo=20(sbagliava=20se=20posizione=20s?= =?UTF-8?q?ul=20bordo=20e=20direzione=20di=20fuga=20tangente=20al=20bordo)?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Operation.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 ;