EgtGeomKernel 2.1a6 :

- corretta intersezione tra linee finite (segmenti) quando praticamente sovrapposte
- a Zmap aggiunte funzioni per Cut e per Compact
- in Zmap migliorate funzione GetTriangles e IsThereMat.
This commit is contained in:
Dario Sassi
2019-01-25 08:00:39 +00:00
parent b8e0af285c
commit 5f820d9f8d
8 changed files with 373 additions and 57 deletions
+21 -20
View File
@@ -471,17 +471,6 @@ VolZmap::GetAllTriangles( TRIA3DEXLIST& lstTria) const
bool
VolZmap::GetTriangles( bool bAllBlocks, INTVECTOR& nModifiedBlocks, TRIA3DEXLISTVECTOR& vLstTria) const
{
// Se nessun blocco modificato, è richiesta esterna e li considero tutti modificati
bool bSomeModif = false ;
for ( size_t i = 0 ; i < m_nNumBlock ; ++ i) {
if ( m_BlockToUpdate[i]) {
bSomeModif = true ;
break ;
}
}
if ( ! bSomeModif)
bAllBlocks = true ;
// Caso di singola mappa
if ( m_nMapNum == 1) {
@@ -2254,6 +2243,7 @@ VolZmap::ExtMarchingCubes( int nBlock, TRIA3DEXLIST& lstTria, VoxelContainer& vV
VoxConf.Compo[tOldCompo].CompVecField[nV] = CompoVert[nComp][nV] ;
}
VoxConf.Compo[tOldCompo].ptVert = ptSol ;
VoxConf.Compo[tOldCompo].vtNullSpace = vtNullSpace ;
VoxConf.Compo[tOldCompo].bInside = IsPointInsideVoxelApprox( i, j, k, ptSol, EPS_SMALL) ;
VoxConf.Compo[tOldCompo].bCorner = ( nFeatureType == CORNER) ;
}
@@ -3400,16 +3390,27 @@ VolZmap::IsThereMat( int nI, int nJ, int nK) const
break ;
}
// verifica spillone su vertice
size_t nIndex = 0 ;
unsigned int nPos = nGrJ * m_nNx[nGrid] + nGrI ;
size_t nDexSize = m_Values[nGrid][nPos].size() ;
while ( nIndex < nDexSize) {
if ( dZ > m_Values[nGrid][nPos][nIndex].dMin - 2 * EPS_SMALL &&
dZ < m_Values[nGrid][nPos][nIndex].dMax + 2 * EPS_SMALL) {
++ nCount ;
break ;
}
nIndex += 1 ;
int nDexSize = int( m_Values[nGrid][nPos].size()) ;
int nMin = 0 ;
int nMax = nDexSize - 1 ;
if ( nMin <= nMax &&
dZ >= m_Values[nGrid][nPos][nMin].dMin - 2 * EPS_SMALL &&
dZ <= m_Values[nGrid][nPos][nMax].dMax + 2 * EPS_SMALL) {
while ( nMin <= nMax) {
int nTest = ( nMin + nMax) / 2 ;
// se prima
if ( dZ < m_Values[nGrid][nPos][nTest].dMin - 2 * EPS_SMALL)
nMax = nTest - 1 ;
// se altrimenti dopo
else if ( dZ > m_Values[nGrid][nPos][nTest].dMax + 2 * EPS_SMALL)
nMin = nTest + 1 ;
// altrimenti è nell'intervallo, trovato ed esco
else {
++ nCount ;
break ;
}
}
}
}
return ( nCount == 3) ;