EgtGeomKernel :

- piccole modifiche a Collision Avoding.
This commit is contained in:
Dario Sassi
2018-05-21 07:24:19 +00:00
parent 5fb64bdb3f
commit 3ff5af8872
3 changed files with 7 additions and 4 deletions
+2 -2
View File
@@ -127,7 +127,7 @@ CAvToolSurfTm::MyTestMidPointHG( PNTULIST& lPntM, const PNTULIST::iterator& itPn
return false ;
// se oltre tolleranza dalla linea tra i punti includenti, devo aggiungerlo
double dSqDist ;
if ( DistPointLine( ptNewMid, itPntMPrev->first, itPntMCurr->first).GetSqDist( dSqDist) && dSqDist > dLinTol * dLinTol) {
if ( DistPointLine( ptNewMid, itPntMPrev->first, itPntMCurr->first).GetSqDist( dSqDist) && dSqDist > 0.25 * dLinTol * dLinTol) {
// aggiungo
lPntM.emplace( itPntMCurr, ptNewMid, - dMidMove) ;
auto itPntMMid = itPntMCurr ;
@@ -225,7 +225,7 @@ CAvToolSurfTm::PrepareHashGrid( void)
if ( m_pSTm == nullptr || ! m_pSTm->IsValid())
return false ;
// creo HashGrid 2d
const int LIM_HG_TRIA = 128 ;
const int LIM_HG_TRIA = 256 ;
m_HGrids.SetActivationGrid( m_pSTm->GetTriangleCount() > LIM_HG_TRIA) ;
// riempio HashGrid
Triangle3d Tria ;
+4
View File
@@ -27,6 +27,10 @@ class CAvToolSurfTm : public ICAvToolSurfTm
bool SetMoveDir( const Vector3d& vtrMove) override ;
bool SetStdTool( double dH, double dR, double dCornR) override ;
bool SetAdvTool( double dH, double dR, double dTipH, double dTipR, double dCornR) override ;
double GetToolRadius( void) override
{ return m_Tool.GetRadius() ; }
double GetToolHeight( void) override
{ return m_Tool.GetHeigth() ; }
bool TestPosition( const Point3d& ptT, const Vector3d& vtDir, double& dTotDist) override ;
bool TestPath( PNTULIST& lPntM, const Vector3d& vtDir, double dLinTol) override ;
+1 -2
View File
@@ -654,8 +654,7 @@ SurfTriMesh::CloneFacet( int nF) const
return nullptr ;
// tabella hash per indici vertici (vecchi e nuovi indici)
typedef unordered_map<int,int> VVMAP ;
VVMAP PntMap ;
PntMap.rehash( nTria + 2) ;
VVMAP PntMap( nTria + 2) ;
// inserisco i triangoli nella nuova superficie
for ( int i = 0 ; i < nTria ; ++ i) {
// indice del triangolo