EgtMachKernel :

- aggiornamento chiamata funzione CDeBoxClosedSurfTm.
This commit is contained in:
Dario Sassi
2020-01-10 10:38:46 +00:00
parent e0f4ca9a7c
commit 3d86e340b7
+7 -4
View File
@@ -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 ;
}