EgtMachKernel :

- corretta GetDistanceFromRawSide per sapere quanto una posizione è all'interno del grezzo (sbagliava se posizione sul bordo e direzione di fuga tangente al bordo).
This commit is contained in:
Dario Sassi
2023-11-06 11:10:41 +01:00
parent 85cdb84a5a
commit d5638e192c
+6 -2
View File
@@ -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 ;