EgtGeomKernel :
- altre modifiche a Zmap per migliorare la visualizzazione.
This commit is contained in:
+18
-12
@@ -1648,7 +1648,7 @@ VolZmap::ExtMarchingCubes( int nBlock, TRIA3DEXLIST& lstTria, TriHolder& triHold
|
||||
for ( int i = nLimits[0] ; i < nLimits[1] ; ++ i) {
|
||||
for ( int j = nLimits[2] ; j < nLimits[3] ; ++ j) {
|
||||
for ( int k = nLimits[4] ; k < nLimits[5] ; ++ k) {
|
||||
|
||||
|
||||
// Classificazione dei vertici: interni o esterni al materiale
|
||||
int nIndex = CalcIndex( i, j, k) ;
|
||||
|
||||
@@ -1996,7 +1996,7 @@ VolZmap::ExtMarchingCubes( int nBlock, TRIA3DEXLIST& lstTria, TriHolder& triHold
|
||||
|
||||
// Caso generale
|
||||
for ( int ni = 0 ; ni < nVertComp[nCompCount - 1] ; ++ ni) {
|
||||
dMatrixN( ni, 0) = vtNorm[ni].x ;
|
||||
dMatrixN( ni, 0) = vtNorm[ni].x ;
|
||||
dMatrixN( ni, 1) = vtNorm[ni].y ;
|
||||
dMatrixN( ni, 2) = vtNorm[ni].z ;
|
||||
dKnownVector( ni) = vtNorm[ni] * vtTrasf[ni] ;
|
||||
@@ -2153,6 +2153,8 @@ VolZmap::ExtMarchingCubes( int nBlock, TRIA3DEXLIST& lstTria, TriHolder& triHold
|
||||
CurrentTriangle.Set( ptSol, CompoVert[nCompCount - 1][nj].ptInt, CompoVert[nCompCount - 1][ni].ptInt) ;
|
||||
CurrentTriangle.SetAttrib( 1, CompoVert[nCompCount - 1][nj].nToolFlag) ;
|
||||
CurrentTriangle.SetAttrib( 2, CompoVert[nCompCount - 1][ni].nToolFlag) ;
|
||||
CurrentTriangle.SetVertexNorm( 1, CompoVert[nCompCount - 1][nj].vtNorm) ;
|
||||
CurrentTriangle.SetVertexNorm( 2, CompoVert[nCompCount - 1][ni].vtNorm) ;
|
||||
if ( CurrentTriangle.GetAttrib( 1) < 0 ||
|
||||
CurrentTriangle.GetAttrib( 2) < 0)
|
||||
CurrentTriangle.SetGrade( - 1) ;
|
||||
@@ -2235,6 +2237,8 @@ VolZmap::ExtMarchingCubes( int nBlock, TRIA3DEXLIST& lstTria, TriHolder& triHold
|
||||
CurrentTriangle.Set( ptSol, CompoVert[nCompCount - 1][nj].ptInt, CompoVert[nCompCount - 1][ni].ptInt) ;
|
||||
CurrentTriangle.SetAttrib( 1, CompoVert[nCompCount - 1][nj].nToolFlag) ;
|
||||
CurrentTriangle.SetAttrib( 2, CompoVert[nCompCount - 1][ni].nToolFlag) ;
|
||||
CurrentTriangle.SetVertexNorm( 1, CompoVert[nCompCount - 1][nj].vtNorm) ;
|
||||
CurrentTriangle.SetVertexNorm( 2, CompoVert[nCompCount - 1][ni].vtNorm) ;
|
||||
if ( CurrentTriangle.GetAttrib( 1) < 0 ||
|
||||
CurrentTriangle.GetAttrib( 2) < 0)
|
||||
CurrentTriangle.SetGrade( - 1) ;
|
||||
@@ -2409,7 +2413,7 @@ VolZmap::ExtMarchingCubes( int nBlock, TRIA3DEXLIST& lstTria, TriHolder& triHold
|
||||
if ( CurrentTriangle.Validate( true)) {
|
||||
for ( int nV = 0 ; nV < 3 ; ++ nV) {
|
||||
const Vector3d& vtVertNorm = CompoTriVert[nCompCount - 1][TriIndex+nV].vtNorm ;
|
||||
if ( CurrentTriangle.GetN() * vtVertNorm > 0.5)
|
||||
if ( CurrentTriangle.GetN() * vtVertNorm > 0.6)
|
||||
CurrentTriangle.SetVertexNorm( nV, vtVertNorm) ;
|
||||
else
|
||||
CurrentTriangle.SetVertexNorm( nV, CurrentTriangle.GetN()) ;
|
||||
@@ -2459,7 +2463,7 @@ VolZmap::ExtMarchingCubes( int nBlock, TRIA3DEXLIST& lstTria, TriHolder& triHold
|
||||
if ( CurrentTriangle.Validate( true)) {
|
||||
for ( int nV = 0 ; nV < 3 ; ++ nV) {
|
||||
const Vector3d& vtVertNorm = CompoTriVert[nCompCount - 1][TriIndex+nV].vtNorm ;
|
||||
if ( CurrentTriangle.GetN() * vtVertNorm > 0.5)
|
||||
if ( CurrentTriangle.GetN() * vtVertNorm > 0.6)
|
||||
CurrentTriangle.SetVertexNorm( nV, vtVertNorm) ;
|
||||
else
|
||||
CurrentTriangle.SetVertexNorm( nV, CurrentTriangle.GetN()) ;
|
||||
@@ -2692,10 +2696,11 @@ VolZmap::FlipEdgesII( TriHolder& TriHold) const
|
||||
TriHold[n2].vCompoTria[nCompo2][nTri2].SetGrade( nCol2) ;
|
||||
// Valido i triangoli
|
||||
TriHold[n1].vCompoTria[nCompo1][nTri1].Validate( true) ;
|
||||
TriHold[n2].vCompoTria[nCompo2][nTri2].Validate( true) ;
|
||||
TriHold[n2].vCompoTria[nCompo2][nTri2].Validate( true) ;
|
||||
// Setto le normali a ogni vertice
|
||||
Vector3d vtNorm1 = TriHold[n1].vCompoTria[nCompo1][nTri1].GetN() ;
|
||||
Vector3d vtNorm2 = TriHold[n2].vCompoTria[nCompo2][nTri2].GetN() ;
|
||||
Vector3d vtNorm1 = TriHold[n1].vCompoTria[nCompo1][nTri1].GetVertexNorm( SharedIndex[2]) ;
|
||||
Vector3d vtNorm2 = TriHold[n2].vCompoTria[nCompo2][nTri2].GetVertexNorm( SharedIndex[1]) ;
|
||||
|
||||
int nFeatureIndex1 = 0 ;
|
||||
int nFeatureIndex2 = 0 ;
|
||||
for ( ; nFeatureIndex1 < 3 && nFeatureIndex2 < 3 ; ) {
|
||||
@@ -2712,6 +2717,7 @@ VolZmap::FlipEdgesII( TriHolder& TriHold) const
|
||||
TriHold[n1].vCompoTria[nCompo1][nTri1].SetVertexNorm( nFeatureIndex1, vtNorm1) ;
|
||||
TriHold[n2].vCompoTria[nCompo2][nTri2].SetVertexNorm( SharedIndex[3], vtNorm2) ;
|
||||
TriHold[n2].vCompoTria[nCompo2][nTri2].SetVertexNorm( nFeatureIndex2, vtNorm2) ;
|
||||
|
||||
bModified = true ;
|
||||
break ;
|
||||
}
|
||||
@@ -2752,8 +2758,8 @@ VolZmap::FlipEdgesII( TriHolder& TriHold) const
|
||||
TriHold[n2].vCompoTria[nCompo2][nTri2].SetGrade( nCol) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( bModified)
|
||||
break ;
|
||||
@@ -2901,9 +2907,9 @@ VolZmap::FlipEdgesBB( TriaMatrix& InterTria) const
|
||||
InterTria[tFB][tVFB].vCompoTria[tCmpF][tTriFB].Validate( true) ;
|
||||
InterTria[tLB][tVLB].vCompoTria[tCmpL][tTriLB].Validate( true) ;
|
||||
|
||||
// Setto le normali a ogni vertice
|
||||
Vector3d vtNormF = InterTria[tFB][tVFB].vCompoTria[tCmpF][tTriFB].GetN() ;
|
||||
Vector3d vtNormL = InterTria[tLB][tVLB].vCompoTria[tCmpL][tTriLB].GetN() ;
|
||||
// Setto le normali a ogni vertice
|
||||
Vector3d vtNormF = InterTria[tFB][tVFB].vCompoTria[tCmpF][tTriFB].GetVertexNorm( SharedIndex[2]) ;
|
||||
Vector3d vtNormL = InterTria[tLB][tVLB].vCompoTria[tCmpL][tTriLB].GetVertexNorm( SharedIndex[1]) ;
|
||||
int nFeatureIndexF = 0 ;
|
||||
int nFeatureIndexL = 0 ;
|
||||
for ( ; nFeatureIndexF < 3 && nFeatureIndexL < 3 ; ) {
|
||||
|
||||
Reference in New Issue
Block a user