diff --git a/EgtGeomKernel.rc b/EgtGeomKernel.rc index 95e9d6f..b1faae2 100644 Binary files a/EgtGeomKernel.rc and b/EgtGeomKernel.rc differ diff --git a/SurfTriMesh.cpp b/SurfTriMesh.cpp index 1a80f28..38b33ea 100644 --- a/SurfTriMesh.cpp +++ b/SurfTriMesh.cpp @@ -3810,12 +3810,19 @@ SurfTriMesh::VerifyConnection( bool bShellsAndParts) const BBox3d b3Box ; PtrOwner pStmShell ; } ; + // vettore di shell con vettori dei propri triangoli (per accelerare nei casi degeneri) + INTMATRIX mShellTria( m_nShells) ; + for ( int i = 0 ; i < ssize( m_vTria) ; ++ i) { + if ( m_vTria[i].nShell < m_nShells) + mShellTria[m_vTria[i].nShell].push_back( i) ; + } + // classificazione delle shell vector vOuterShells ; vector vInnerShells ; INTVECTOR vOpenShells ; for ( int nSh = 0 ; nSh < m_nShells ; ++ nSh) { // se la shell รจ chiusa - if ( IsShellClosed( nSh)) { + if ( ssize( mShellTria[nSh]) >= 4 && IsShellClosed( nSh)) { // creo una superficie clonata dalla shell PtrOwner pStmShell( CloneShell( nSh)) ; if ( IsNull( pStmShell) || ! pStmShell->IsValid()) @@ -3827,7 +3834,9 @@ SurfTriMesh::VerifyConnection( bool bShellsAndParts) const BBox3d b3Box ; pStmShell->GetLocalBBox( b3Box, BBF_STANDARD) ; // la inserisco nel vettore opportuno - if ( dVol > 0) + if ( abs( dVol) < 1 * 1 * EPS_SMALL) + vOpenShells.push_back( nSh) ; + else if ( dVol > 0) vOuterShells.emplace_back( nSh, dVol, b3Box, Release( pStmShell)) ; else vInnerShells.emplace_back( nSh, dVol, b3Box, Release( pStmShell)) ; @@ -3979,6 +3988,7 @@ SurfTriMesh::IsShellClosed( int nShell) const return false ; // ciclo sui triangoli della shell bool bClosed = true ; + int nTriaCnt = 0 ; for ( int i = 0 ; i < GetTriangleSize() ; ++ i) { // se triangolo non cancellato e della shell if ( m_vTria[i].nIdVert[0] != SVT_DEL && m_vTria[i].nShell == nShell) { @@ -3989,10 +3999,12 @@ SurfTriMesh::IsShellClosed( int nShell) const bClosed = false ; break ; } + else + ++ nTriaCnt ; } } // restituisco il risultato - return bClosed ; + return ( bClosed && nTriaCnt >= 4) ; } //----------------------------------------------------------------------------