EgtGeomKernel 1.8d2 :

- correzione a CurveComposite::RemoveUndercutOnY per tratti di archi che sono praticamente linee verticali.
This commit is contained in:
Dario Sassi
2017-04-26 16:26:43 +00:00
parent 36aa2c117a
commit 7116fe6aba
2 changed files with 7 additions and 8 deletions
+7 -8
View File
@@ -2749,29 +2749,28 @@ CurveComposite::RemoveUndercutOnY( double dLinTol, double dAngTolDeg)
double dYmin = b3Box.GetMin().y - DELTA_Y ;
PtrOwner<ICurve> pCrv ;
while ( pCrv.Set( ccCopy.RemoveFirstOrLastCurve( false))) {
// se linea verticale non sottende alcunché, quindi la salto
if ( pCrv->GetType() == CRV_LINE) {
const CurveLine* pLine = GetBasicCurveLine( pCrv) ;
if ( abs( pLine->GetStart().x - pLine->GetEnd().x) < EPS_SMALL) {
pCrv.Reset() ;
continue ;
}
}
// creo la regione sottesa dalla curva
PtrOwner<CurveComposite> pCompo( CreateBasicCurveComposite()) ;
if ( IsNull( pCompo))
return false ;
pCompo->AddCurve( Release( pCrv)) ;
// estremi
Point3d ptStart, ptEnd ;
pCompo->GetStartPoint( ptStart) ;
pCompo->GetEndPoint( ptEnd) ;
// se curva pressochè verticale non sottende alcunché, quindi la salto
if ( abs( ptStart.x - ptEnd.x) < EPS_SMALL)
continue ;
// ordino gli estremi
if ( ptStart.x < ptEnd.x) {
swap( ptStart, ptEnd) ;
pCompo->Invert() ;
}
// chiudo la curva
pCompo->AddLine( Point3d( ptEnd.x, dYmin, ptEnd.z)) ;
pCompo->AddLine( Point3d( ptStart.x, dYmin, ptStart.z)) ;
pCompo->Close() ;
// creo regione sottesa
SurfFlatRegion Sfr ;
Sfr.AddExtLoop( Release( pCompo)) ;
if ( ! Sfr.IsValid())
BIN
View File
Binary file not shown.