diff --git a/CurveComposite.cpp b/CurveComposite.cpp index 023a7a2..558e229 100644 --- a/CurveComposite.cpp +++ b/CurveComposite.cpp @@ -2749,29 +2749,28 @@ CurveComposite::RemoveUndercutOnY( double dLinTol, double dAngTolDeg) double dYmin = b3Box.GetMin().y - DELTA_Y ; PtrOwner 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 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()) diff --git a/EgtGeomKernel.rc b/EgtGeomKernel.rc index e21fe9e..b1ef3ea 100644 Binary files a/EgtGeomKernel.rc and b/EgtGeomKernel.rc differ