EgtGeomKernel 2.3h3 :
- correzione crezione regioni da curve chiuse (contorni esterni che si intersecano e diventano in parte anche contorni interni).
This commit is contained in:
+18
-3
@@ -17,6 +17,7 @@
|
||||
#include "CurveArc.h"
|
||||
#include "CurveComposite.h"
|
||||
#include "SurfFlatRegion.h"
|
||||
#include "AdjustLoops.h"
|
||||
#include "GeoConst.h"
|
||||
#include "/EgtDev/Include/EgkPolyLine.h"
|
||||
#include "/EgtDev/Include/EgkBiArcs.h"
|
||||
@@ -363,8 +364,20 @@ SurfFlatRegionByContours::AddCurve( ICurve* pCrv)
|
||||
// verifico sia chiusa
|
||||
if ( ! pMyCrv->IsClosed())
|
||||
return false ;
|
||||
// la inserisco nel vettore delle curve
|
||||
m_vpCrv.push_back( Release( pMyCrv)) ;
|
||||
// verifico sia piana e imposto estrusione come normale al piano
|
||||
double dArea ;
|
||||
Plane3d plPlane ;
|
||||
if ( ! pMyCrv->GetArea( plPlane, dArea))
|
||||
return false ;
|
||||
pMyCrv->SetExtrusion( plPlane.GetVersN()) ;
|
||||
pMyCrv->SetThickness( 0) ;
|
||||
// rimuovo eventuali sovrapposizioni (calcolate nel suo piano)
|
||||
ICURVEPLIST CrvLst ;
|
||||
if ( ! AdjustLoops( Release( pMyCrv), CrvLst))
|
||||
return false ;
|
||||
// la/le inserisco nel vettore delle curve
|
||||
for ( auto& pSingCrv : CrvLst)
|
||||
m_vpCrv.push_back( pSingCrv) ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
@@ -418,6 +431,7 @@ SurfFlatRegionByContours::GetSurf( void)
|
||||
if ( IsNull( pSfr))
|
||||
return nullptr ;
|
||||
// aggiungo le diverse curve
|
||||
bool bExtLoop = false ;
|
||||
bool bFirstCrv ;
|
||||
do {
|
||||
bFirstCrv = true ;
|
||||
@@ -436,6 +450,7 @@ SurfFlatRegionByContours::GetSurf( void)
|
||||
}
|
||||
// provo a inserirla
|
||||
if ( pSfr->AddExtLoop( Release( pCrv))) {
|
||||
bExtLoop = true ;
|
||||
bFirstCrv = false ;
|
||||
delete m_vpCrv[j] ;
|
||||
m_vpCrv[j] = nullptr ;
|
||||
@@ -460,7 +475,7 @@ SurfFlatRegionByContours::GetSurf( void)
|
||||
}
|
||||
} while ( m_bAllowedMultiChunk && ! bFirstCrv) ;
|
||||
// se non valida, errore
|
||||
if ( ! pSfr->IsValid())
|
||||
if ( ! bExtLoop || ! pSfr->IsValid())
|
||||
return nullptr ;
|
||||
// restituisco la superficie
|
||||
return Release( pSfr) ;
|
||||
|
||||
Reference in New Issue
Block a user