EgtExecutor :

- aggiunto check per la scelta del lato a cui appliare l'interpolazione delle direzioni di lavorazione
- corretta gestione delle direzioni rispetto al bordo scelto per l'operazione di interpolazione.
This commit is contained in:
Daniele Bariletti
2026-05-22 10:44:43 +02:00
parent a2c8797930
commit 60e7f9040a
2 changed files with 22 additions and 13 deletions
+10 -3
View File
@@ -874,7 +874,8 @@ ExeTrimmingGetSurfBzSyncPoints( int nParentId, int nEdge1Id, int nEdge2Id, doubl
// ---------------------------------------------------------------------------
bool
ExeTrimmingGetToolOrientationLines( int nParentId, int nMainEdgeId, int nOtherEdgeId, bool bMainIsFirstBorder, int nSyncLayerId, int nLineSId, int nLineEId,
ExeTrimmingGetToolOrientationLines( int nParentId, int nMainEdgeId, int nOtherEdgeId, bool bMainIsFirstBorder, int nSyncLayerId,
int nLineSId, int nLineEId, bool bShorterSide,
double dThetaStart, double dPhiStart, double dThetaEnd, double dPhiEnd, double dInterpLenS,
double dInterpLenE, double dLinTol,
int& nInterpStartId, int& nStartId, int& nEndId, int& nInterpEndId)
@@ -890,7 +891,7 @@ ExeTrimmingGetToolOrientationLines( int nParentId, int nMainEdgeId, int nOtherEd
double dMyLinTol = Clamp( dLinTol, EPS_SMALL, 1e5 * EPS_SMALL) ;
const double TOL = dMyLinTol ;
// Definisco costanti per interpolazione
const double INTERPOLATION_DIST = 0.5 ; // alzare
const double INTERPOLATION_DIST = 2 ;
const double ISO_PAR_SAMPLE = 20.0 ;
// Recupero il riferimento del gruppo di destinazione
@@ -950,9 +951,11 @@ ExeTrimmingGetToolOrientationLines( int nParentId, int nMainEdgeId, int nOtherEd
double dLenE = 0., dLenMain = 0. ;
bOk = ( pCompoMainCL->GetLengthAtPoint( Line2.first, dLenE, TOL) &&
pCompoMainCL->GetLength( dLenMain)) ;
if ( dLenE > dLenMain / 2. + EPS_SMALL) {
if ( dLenE > dLenMain / 2. + EPS_SMALL && bShorterSide) {
swap( Line1, Line2) ;
swap( pCrvSyncS, pCrvSyncE) ;
swap( dThetaStart, dThetaEnd) ;
swap( dPhiStart, dPhiEnd) ;
}
}
}
@@ -1063,6 +1066,8 @@ ExeTrimmingGetToolOrientationLines( int nParentId, int nMainEdgeId, int nOtherEd
pCompoIso->IsValid() &&
pCompoIso->GetStartPoint( LineInterpS.first) &&
pCompoIso->GetEndPoint( LineInterpS.second)) ;
if ( ! bMainIsFirstBorder)
swap( LineInterpS.first, LineInterpS.second) ;
if ( bOk) {
bool bFirst = true ;
// Interpolo
@@ -1179,6 +1184,8 @@ ExeTrimmingGetToolOrientationLines( int nParentId, int nMainEdgeId, int nOtherEd
pCompoIso->IsValid() &&
pCompoIso->GetStartPoint( LineInterpE.first) &&
pCompoIso->GetEndPoint( LineInterpE.second)) ;
if ( ! bMainIsFirstBorder)
swap( LineInterpE.first, LineInterpE.second) ;
if ( bOk) {
// Interpolo
double dLenLineInterpE = Dist( LineInterpE.first, LineInterpE.second) ;
+12 -10
View File
@@ -287,7 +287,7 @@ LuaTrimmingGetSurfBzSyncPoints( lua_State* L)
static int
LuaTrimmingGetToolOrientationLines( lua_State* L)
{
// 14 parametri : nParentId, nMainEdgeId, nOtherEdgeId, bMainIsFirstBorder, nSyncLayerId, nLineSId, nLineEId,
// 15 parametri : nParentId, nMainEdgeId, nOtherEdgeId, bMainIsFirstBorder, nSyncLayerId, nLineSId, nLineEId, bShorterSide
// dThetaStart, dPhiStart, dThetaEnd, dPhiEnd, dInterpLenS, dInterpLenE, dLinTol
int nParentId ;
LuaCheckParam( L, 1, nParentId)
@@ -301,26 +301,28 @@ LuaTrimmingGetToolOrientationLines( lua_State* L)
LuaCheckParam( L, 5, nLineSId)
int nLineEId ;
LuaCheckParam( L, 6, nLineEId)
bool bShorterSide ;
LuaCheckParam( L, 7, bShorterSide)
int nSyncLayerId ;
LuaCheckParam( L, 7, nSyncLayerId)
LuaCheckParam( L, 8, nSyncLayerId)
double dThetaStart ;
LuaCheckParam( L, 8, dThetaStart)
LuaCheckParam( L, 9, dThetaStart)
double dPhiStart ;
LuaCheckParam( L, 9, dPhiStart)
LuaCheckParam( L, 10, dPhiStart)
double dThetaEnd ;
LuaCheckParam( L, 10, dThetaEnd)
LuaCheckParam( L, 11, dThetaEnd)
double dPhiEnd ;
LuaCheckParam( L, 11, dPhiEnd) ;
LuaCheckParam( L, 12, dPhiEnd) ;
double dInterpLenS ;
LuaCheckParam( L, 12, dInterpLenS)
LuaCheckParam( L, 13, dInterpLenS)
double dInterpLenE ;
LuaCheckParam( L, 13, dInterpLenE)
LuaCheckParam( L, 14, dInterpLenE)
double dLinTol ;
LuaCheckParam( L, 14, dLinTol)
LuaCheckParam( L, 15, dLinTol)
LuaClearStack( L) ;
// Inserisco i tratti lineari associati calcolati lungo il percorso
int nInterpStartId = GDB_ID_NULL, nStartId = GDB_ID_NULL, nEndId = GDB_ID_NULL, nInterpEndId = GDB_ID_NULL ;
bool bOk = ExeTrimmingGetToolOrientationLines( nParentId, nMainEdgeId, nOtherEdgeId, bMainIsFirstBorder, nSyncLayerId, nLineSId, nLineEId,
bool bOk = ExeTrimmingGetToolOrientationLines( nParentId, nMainEdgeId, nOtherEdgeId, bMainIsFirstBorder, nSyncLayerId, nLineSId, nLineEId, bShorterSide,
dThetaStart, dPhiStart, dThetaEnd, dPhiEnd, dInterpLenS, dInterpLenE, dLinTol,
nInterpStartId, nStartId, nEndId, nInterpEndId) ;
LuaSetParam( L, bOk) ;