From cbd487e4ff1a821c15c86a65fe62de835e914b8e Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Thu, 21 May 2026 12:47:21 +0200 Subject: [PATCH] EgtGeomKernel 3.1e4 : - modifiche a VerifyConnection di TriMesh per renderla abbastanza veloce con superfici patologiche. --- EgtGeomKernel.rc | Bin 11710 -> 11710 bytes SurfTriMesh.cpp | 18 +++++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/EgtGeomKernel.rc b/EgtGeomKernel.rc index 95e9d6f923e9b8e42a7c65bfca6369263d089fdf..b1faae2115fe8ae44a930d0aa589e4b865b6f67b 100644 GIT binary patch delta 236 zcmdlNy)SyhI%aKGhCGIJh8%`WhGK>c1_cHUhESkLCPN8BDnkm89}HwAf_cT0PijeT z{=m$}%xJRtyqqG4`lwjSxVewp10r;uY4S3`JfN_k6i~QJ7*lvJ3$os9QmsEYnTvVZ l 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) ; } //----------------------------------------------------------------------------