From 75d5fc367c9cff627fa22f33ce2f8cbf73e5942d Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Wed, 2 Oct 2024 17:29:38 +0200 Subject: [PATCH] EgtExchange 2.6j1 : - in import BTL le feature FreeContour torte ora sono meglio approssimate utilizzando nei calcoli anche le superfici di Bezier. --- BtlGeomProc.cpp | 24 ++++++++++++++++++------ EgtExchange.rc | Bin 11670 -> 11678 bytes 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/BtlGeomProc.cpp b/BtlGeomProc.cpp index 34eab96..a773cea 100644 --- a/BtlGeomProc.cpp +++ b/BtlGeomProc.cpp @@ -37,6 +37,7 @@ #include "/EgtDev/Include/EGkExtText.h" #include "/EgtDev/Include/EGkStmFromCurves.h" #include "/EgtDev/Include/EGkStmFromTriangleSoup.h" +#include "/EgtDev/Include/EGkSbzFromCurves.h" #include "/EgtDev/Include/EGkSfrCreate.h" #include "/EgtDev/Include/EGkDistLineLine.h" #include "/EgtDev/Include/EGkIntersLinePlane.h" @@ -7673,6 +7674,7 @@ BtlGeom::CreateFreeContours( void) } } // verifico se ci sono torsioni, nel qual caso spezzo opportunamente + bool bTwist = false ; if ( ! bTrans && PL.GetPointNbr() == PL2.GetPointNbr()) { // recupero le liste di punti delle due polilinee PNTULIST& lstPU1 = PL.GetUPointList() ; @@ -7687,6 +7689,7 @@ BtlGeom::CreateFreeContours( void) double dDist ; DistLineLine dstDiag( PU1p->first, PU2s->first, PU2p->first, PU1s->first) ; if ( dstDiag.GetDist( dDist) && dDist > FC_TWIST_DIAG_DIST) { + bTwist = true ; // inserisco punti medi lstPU1.emplace( PU1s, Media( PU1p->first, PU1s->first), ( PU1p->second + PU1s->second) / 2) ; lstPU2.emplace( PU2s, Media( PU2p->first, PU2s->first), ( PU2p->second + PU2s->second) / 2) ; @@ -7703,13 +7706,22 @@ BtlGeom::CreateFreeContours( void) } } } - // creo la superficie rigata corrispondente - pStm.Set( CreateSurfTriMesh()) ; - if ( IsNull( pStm)) { - bOk = false ; - continue ; + // Creo la superficie rigata corrispondente + // Se con torsione e senza svuotatura, tramite bezier + if ( bTwist && ! ( bClosed && bPocket)) { + PtrOwner pSbz( GetSurfBezierRuled( pCrvCompo, pCrvCompo2, ISurfBezier::RLT_B_ISOPAR)) ; + if ( ! IsNull( pSbz)) + pStm.Set( pSbz->GetApproxSurf( 10 * EPS_SMALL)) ; } - if ( pStm->CreateByTwoCurves( PL, PL2, ISurfTriMesh::RLT_ISOPAR_SMOOTH)) { + // altrimenti direttamente + else { + pStm.Set( CreateSurfTriMesh()) ; + if ( ! IsNull( pStm)) { + if ( ! pStm->CreateByTwoCurves( PL, PL2, ISurfTriMesh::RLT_ISOPAR_SMOOTH)) + pStm.Reset() ; + } + } + if ( ! IsNull( pStm)) { if ( ( nGroup == 4 && bTwoBottom) || ( nGroup != 4 && ! bTwoBottom)) pStm->Invert() ; // se chiusa e con flag di svuotatura diff --git a/EgtExchange.rc b/EgtExchange.rc index 71b340bc94deef0716d523d6c9dea5dddd245832..8e9961bee296fa098925cbeb20a8312aa8ebcfab 100644 GIT binary patch delta 94 zcmbOhJuiC0H#TNN27}ED<&H8<-ou&2n6>%6WG&<7CEO;=PzhsZuwXUg<_=*qm>`ns MjVu@n1C-sk040kb#sB~S delta 86 zcmbOiJuP~}H#SDg&3E~ZGELscnZ=m7Sx~5&aq|*xGiI=`F*8_bBMTNq1=6UBY8f|2 IDZ6k105jkmGynhq