EgtGeomKernel 2.5j1 :

- aggiunta funzione SubtractProjectedFacesOnStmFace
- modifica funzione GetSilhouette con aggiunta di parametro opzionale.
This commit is contained in:
Riccardo Elitropi
2023-10-04 12:22:17 +02:00
parent 041cbe4a8f
commit 18d7e471ae
6 changed files with 748 additions and 4 deletions
+6 -3
View File
@@ -1069,7 +1069,7 @@ SurfTriMesh::MarchOneTria( int& nT, int& nV, int nTimeStamp,
//----------------------------------------------------------------------------
bool
SurfTriMesh::GetSilhouette( const Vector3d& vtDir, double dTol, POLYLINEVECTOR& vPL) const
SurfTriMesh::GetSilhouette( const Vector3d& vtDir, double dTol, POLYLINEVECTOR& vPL, bool bAllTria) const
{
// Verifico lo stato
if ( m_nStatus != OK)
@@ -1166,17 +1166,20 @@ SurfTriMesh::GetSilhouette( const Vector3d& vtDir, double dTol, POLYLINEVECTOR&
int nT = GetFirstTriangle( Tria) ;
while ( nT != SVT_NULL) {
// verifico la normale e il triangolo proiettato
if ( Tria.GetN() * vtVers > EPS_ZERO &&
if ( ( ( bAllTria && abs( Tria.GetN() * vtVers) > EPS_ZERO) ||
( ! bAllTria && Tria.GetN() * vtVers > EPS_ZERO)) &&
Tria.Scale( frOCS, 1, 1, 0) && Tria.GetSqMinHeight() > SQ_EPS_SMALL) {
PtrOwner<ISurfFlatRegion> pSfrTria( GetSurfFlatRegionFromTriangle( Tria)) ;
if ( ! IsNull( pSfrTria)) {
if ( bAllTria && Tria.GetN() * vtVers < 0)
pSfrTria->Invert() ;
pSfrTria->Offset( dTol, ICurve::OFF_FILLET) ;
if ( IsNull( pSfr))
pSfr.Set( pSfrTria) ;
else
pSfr->Add( *pSfrTria) ;
}
}
}
// passo al successivo
nT = GetNextTriangle( nT, Tria) ;
}