From ba1aa1e77b114f8f9ce5736e79fa4ca3673f151d Mon Sep 17 00:00:00 2001 From: Daniele Bariletti Date: Wed, 26 Aug 2026 09:26:41 +0200 Subject: [PATCH] EgtExecutor 3.1h4 : - cambio versione - aggiunti due argomenti per l'interpolazione delle curve si sync per il trimming. --- EXE_GdbCreateSurf.cpp | 2 +- EXE_Trimming.cpp | 36 ++++++++++++++++++++++++++++++++++-- EgtExecutor.rc | Bin 20614 -> 20614 bytes Lua_Trimming.cpp | 8 ++++++-- 4 files changed, 41 insertions(+), 5 deletions(-) diff --git a/EXE_GdbCreateSurf.cpp b/EXE_GdbCreateSurf.cpp index 117f1b4..9d5720f 100644 --- a/EXE_GdbCreateSurf.cpp +++ b/EXE_GdbCreateSurf.cpp @@ -3096,7 +3096,7 @@ ExeCreateSurfExtensionFromMany( int nParentId, const INTVECTOR& vSurfId, double if ( pnCount != nullptr) ++ *pnCount ; } - if ( bDrawOffEdge && pOffEdge->IsValid()) { + if ( bDrawOffEdge && pOffEdge != nullptr && pOffEdge->IsValid()) { int nEdgeId = pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, pOffEdge) ; if ( nEdgeId != GDB_ID_NULL) { if ( pnCount != nullptr) diff --git a/EXE_Trimming.cpp b/EXE_Trimming.cpp index 7688b52..4bf8442 100644 --- a/EXE_Trimming.cpp +++ b/EXE_Trimming.cpp @@ -649,7 +649,7 @@ ExeTrimmingGetRuledBezier( int nParentId, const INTVECTOR& vIds, int nEdge1Id, i // --------------------------------------------------------------------------- bool ExeTrimmingInterpolateSyncLines( int nParentId, int nSync1Id, int nSync2Id, int nBorder1Id, - int nBorder2Id, double dEdgeLinTol, double dEdgeAngTol, + int nBorder2Id, double dEdgeLinTol, double dEdgeAngTol, bool bShorterSide, bool bEraseOrigLines, int& nFirstId, int& nCount) { // Verifica database geometrico @@ -678,9 +678,41 @@ ExeTrimmingInterpolateSyncLines( int nParentId, int nSync1Id, int nSync2Id, int // Calcolo le Curve di sincornizzazione Interpolate BIPNTVECTOR vSyncPoints ; + GuideBounds gbGuideBounds ; bOk = bOk && GetTrimmingSyncInterpolation( pCrvEdge1, pCrvEdge2, pSync1, pSync2, dMyEdgeLinTol, - dMyEdgeAngTol, vSyncPoints) ; + dMyEdgeAngTol, bShorterSide, vSyncPoints, gbGuideBounds) ; if ( bOk && ! vSyncPoints.empty()) { + if ( bEraseOrigLines) { + // scorro tutte le curve si sync giĆ  presenti e le elimino se entro i limiti della zona di interpolazione + int nSyncId = pGeomDB->GetFirstInGroup( nParentId) ; + while ( nSyncId != GDB_ID_NULL) { + double dS, dE ; + Point3d ptStart, ptEnd ; + ICurve* pSync = GetCurve( pGeomDB->GetGeoObj( nSyncId)) ; + pSync->GetStartPoint( ptStart) ; + pSync->GetEndPoint( ptEnd) ; + if ( ! pCrvEdge1->GetParamAtPoint( ptStart, dS, dMyEdgeLinTol)) { + pSync->Invert() ; + swap( ptStart, ptEnd) ; + if ( ! pCrvEdge1->GetParamAtPoint( ptStart, dS, dMyEdgeLinTol)) { + pSync->Invert() ; + bOk = false ; + break ; + } + } + if ( ! pCrvEdge2->GetParamAtPoint( ptEnd, dE, dMyEdgeLinTol)) { + bOk = false ; + break ; + } + int nCurrId = nSyncId ; + nSyncId = pGeomDB->GetNext( nSyncId) ; + if ( ( gbGuideBounds.bDirect && + (( dS > gbGuideBounds.dS1 && dS < gbGuideBounds.dE1) || ( dE > gbGuideBounds.dS2 && dE < gbGuideBounds.dE2))) || + ( ! gbGuideBounds.bDirect && + (( dS < gbGuideBounds.dS1 || dS > gbGuideBounds.dE1) || ( dE < gbGuideBounds.dS2 || dE > gbGuideBounds.dE2)))) + pGeomDB->Erase( nCurrId) ; + } + } // Inserisco le curve di sincronizzazione nel DB // [orientate da pCrvEdge1 a pCrvEdge2] for ( int i = 0 ; bOk && i < ssize( vSyncPoints) ; ++ i) { diff --git a/EgtExecutor.rc b/EgtExecutor.rc index 54ef07b0ca828fc1f1d006fbb1c0faa97fd4f25a..b1a85cd4fc2811caf2b1dbe31c57be970b0ee4c7 100644 GIT binary patch delta 236 zcmZo$$k?`!al<-hbx(#ohIED;hE#@PAXZ?|U-m#gixc zN^kza%*M=Uy!ktuE0CJ(D5$$Ri>rzSEOMM_@*2S^i0I@jF0;*DLN*|o<6>~NR#FJH zHHye;qm)jmlIWO&ll4>=OE~hZ$9B^F-gTOaOar BL|6a- diff --git a/Lua_Trimming.cpp b/Lua_Trimming.cpp index 31d13dd..e1af756 100644 --- a/Lua_Trimming.cpp +++ b/Lua_Trimming.cpp @@ -226,7 +226,7 @@ LuaTrimmingGetRuledBezier( lua_State* L) static int LuaTrimmingInterpolateSyncLines( lua_State* L) { - // 7 parametri : nParentId, nFirstSyncId, nSecondSyncId, nBorder1Id, nBorder2Id, dEdgeLinTol, dEdgeAngTol + // 9 parametri : nParentId, nFirstSyncId, nSecondSyncId, nBorder1Id, nBorder2Id, dEdgeLinTol, dEdgeAngTol, bShorterSide, bEraseOrigLines int nParentId ; LuaCheckParam( L, 1, nParentId) ; int nSync1Id ; @@ -241,12 +241,16 @@ LuaTrimmingInterpolateSyncLines( lua_State* L) LuaCheckParam( L, 6, dEdgeLinTol) ; double dEdgeAngTol ; LuaCheckParam( L, 7, dEdgeAngTol) ; + bool bShorterSide = true ; + LuaCheckParam( L, 8, bShorterSide) ; + bool bEraseOrigLines = true ; + LuaCheckParam( L, 9, bEraseOrigLines) ; LuaClearStack( L) ; // Interpolo le curve di sincronizzazione int nFirstId = GDB_ID_NULL ; int nCount = 0 ; bool bOk = ExeTrimmingInterpolateSyncLines( nParentId, nSync1Id, nSync2Id, nBorder1Id, - nBorder2Id, dEdgeLinTol, dEdgeAngTol, nFirstId, nCount) ; + nBorder2Id, dEdgeLinTol, dEdgeAngTol, bShorterSide, bEraseOrigLines, nFirstId, nCount) ; LuaSetParam( L, bOk) ; LuaSetParam( L, nFirstId) ; LuaSetParam( L, nCount) ;