diff --git a/Operation.cpp b/Operation.cpp index 3c6a667..f513a27 100644 --- a/Operation.cpp +++ b/Operation.cpp @@ -29,7 +29,7 @@ #include "/EgtDev/Include/EGkIntersCurves.h" #include "/EgtDev/Include/EGkIntersLineSurfTm.h" #include "/EgtDev/Include/EGkGeomDB.h" -#include "/EgtDev/Include/EGkCDeBoxPolyhedron.h" +#include "/EgtDev/Include/EGkCDeBoxClosedSurfTm.h" #include "/EgtDev/Include/EXeConst.h" #include "/EgtDev/Include/EgtPointerOwner.h" @@ -2197,8 +2197,9 @@ Operation::TestCollisionAvoid( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEn INTVECTOR vCollId ; pMch->GetCurrHeadCollGroups( vCollId) ; // distanza di sicurezza + const double MIN_SAFEDIST = 10.0 ; double dSafeDist = m_pMchMgr->GetCurrMachiningsMgr()->GetSafeZ() ; - dSafeDist = min( dSafeDist, max( 0.5 * dSafeDist, 10.0)) ; + dSafeDist = min( dSafeDist, max( 0.5 * dSafeDist, MIN_SAFEDIST)) ; // Vado nelle posizioni da controllare const int COLL_STEP = 16 ; bool bCollide = false ; @@ -2240,11 +2241,13 @@ Operation::TestCollisionAvoid( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEn // sottobox testa nel riferimento del solido BBox3d b3Hsol ; m_pGeomDB->GetRefBBox( biSH.second, frSolid, b3Hsol) ; - b3Hsol.Expand( dSafeDist) ; + Point3d ptMin ; + Vector3d vtDiag ; + b3Hsol.GetMinDim( ptMin, vtDiag.x, vtDiag.y, vtDiag.z) ; // solido const ISurfTriMesh* pStm = GetSurfTriMesh( m_pGeomDB->GetGeoObj( nRawSolidId)) ; // verifica di collisione tra sottobox e solido - if ( pStm == nullptr || CDeBoxPolyhedron( b3Hsol, *pStm)) { + if ( pStm == nullptr || CDeBoxClosedSurfTm( Frame3d( ptMin), vtDiag, dSafeDist, *pStm)) { bCollide = true ; break ; }