From d96660e6d1432d2ed5bed88a1cb8948ac1a95e0f Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 22 Jan 2024 08:37:05 +0100 Subject: [PATCH] EgtGeomKernel : - correzione verifica collisione tra SurfTrimesh chiusa e Zmap. --- VolZmapCalculus.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/VolZmapCalculus.cpp b/VolZmapCalculus.cpp index 9e7e8f6..cadc688 100644 --- a/VolZmapCalculus.cpp +++ b/VolZmapCalculus.cpp @@ -1930,9 +1930,12 @@ VolZmap::AvoidSurfTm( const ISurfTriMesh& tmSurf, double dSafeDist, bool bPrecis } // Intersezione della linea con triangolo eventualmente offsettato Point3d ptInt, ptInt2 ; - if ( IntersLineTria( ptT, vtK, 1, trNewTria, ptInt, ptInt2, false) != IntLineTriaType::ILTT_NO) { + int nIntLnTr = IntersLineTria( ptT, vtK, 1, trNewTria, ptInt, ptInt2, false) ; + if ( nIntLnTr != ILTT_NO) { double dZmin = ( ptInt - ptT) * vtK ; - double dZmax = ( ptInt2 - ptT) * vtK ; + double dZmax = dZmin ; + if ( nIntLnTr == ILTT_SEGM || nIntLnTr == ILTT_SEGM_ON_EDGE) + dZmax = ( ptInt2 - ptT) * vtK ; for ( int nIndex = 0 ; nIndex < nSize ; nIndex += 1) { if ( dZmax > m_Values[0][nPos][nIndex].dMin - EPS_SMALL && dZmin < m_Values[0][nPos][nIndex].dMax + EPS_SMALL)