diff --git a/EXE_Trimming.cpp b/EXE_Trimming.cpp index 998ee3e..d63a883 100644 --- a/EXE_Trimming.cpp +++ b/EXE_Trimming.cpp @@ -874,7 +874,7 @@ ExeTrimmingGetSurfBzSyncPoints( int nParentId, int nEdge1Id, int nEdge2Id, doubl // --------------------------------------------------------------------------- bool -ExeTrimmingGetToolOrientationLines( int nParentId, int nMainEdgeId, int nOtherEdgeId, int nSyncLayerId, int nLineSId, int nLineEId, +ExeTrimmingGetToolOrientationLines( int nParentId, int nMainEdgeId, int nOtherEdgeId, bool bMainIsFirstBorder, int nSyncLayerId, int nLineSId, int nLineEId, double dThetaStart, double dPhiStart, double dThetaEnd, double dPhiEnd, double dInterpLenS, double dInterpLenE, double dLinTol, int& nInterpStartId, int& nStartId, int& nEndId, int& nInterpEndId) @@ -1007,12 +1007,22 @@ ExeTrimmingGetToolOrientationLines( int nParentId, int nMainEdgeId, int nOtherEd // Recupero la superficie Bezier rigata PtrOwner pSurfBzRuled ; if ( bOk) { - // Se non ho linee di sincronizzazione - if ( vSyncPoints.empty()) - pSurfBzRuled.Set( GetSurfBezierRuledSmooth( pCrvMainEdge, pCrvOtherEdge, vSyncPoints, ISO_PAR_SAMPLE)) ; - // Se ho linee di sincronizzazione - else - pSurfBzRuled.Set( GetSurfBezierRuledGuided( pCrvMainEdge, pCrvOtherEdge, vSyncPoints, dMyLinTol)) ; + if ( bMainIsFirstBorder) { + // Se non ho linee di sincronizzazione + if ( vSyncPoints.empty()) + pSurfBzRuled.Set( GetSurfBezierRuledSmooth( pCrvMainEdge, pCrvOtherEdge, vSyncPoints, ISO_PAR_SAMPLE)) ; + // Se ho linee di sincronizzazione + else + pSurfBzRuled.Set( GetSurfBezierRuledGuided( pCrvMainEdge, pCrvOtherEdge, vSyncPoints, dMyLinTol)) ; + } + else { + // Se non ho linee di sincronizzazione + if ( vSyncPoints.empty()) + pSurfBzRuled.Set( GetSurfBezierRuledSmooth( pCrvOtherEdge, pCrvMainEdge, vSyncPoints, ISO_PAR_SAMPLE)) ; + // Se ho linee di sincronizzazione + else + pSurfBzRuled.Set( GetSurfBezierRuledGuided( pCrvOtherEdge, pCrvMainEdge, vSyncPoints, dMyLinTol)) ; + } bOk = bOk && ( ! IsNull( pSurfBzRuled) && pSurfBzRuled->IsValid()) ; } diff --git a/Lua_Trimming.cpp b/Lua_Trimming.cpp index 657fef5..a12aad1 100644 --- a/Lua_Trimming.cpp +++ b/Lua_Trimming.cpp @@ -287,7 +287,7 @@ LuaTrimmingGetSurfBzSyncPoints( lua_State* L) static int LuaTrimmingGetToolOrientationLines( lua_State* L) { - // 13 parametri : nParentId, nMainEdgeId, nOtherEdgeId, nSyncLayerId, nLineSId, nLineEId, + // 14 parametri : nParentId, nMainEdgeId, nOtherEdgeId, bMainIsFirstBorder, nSyncLayerId, nLineSId, nLineEId, // dThetaStart, dPhiStart, dThetaEnd, dPhiEnd, dInterpLenS, dInterpLenE, dLinTol int nParentId ; LuaCheckParam( L, 1, nParentId) @@ -295,30 +295,32 @@ LuaTrimmingGetToolOrientationLines( lua_State* L) LuaCheckParam( L, 2, nMainEdgeId) int nOtherEdgeId ; LuaCheckParam( L, 3, nOtherEdgeId) + bool bMainIsFirstBorder ; + LuaCheckParam( L, 4, bMainIsFirstBorder) int nLineSId ; - LuaCheckParam( L, 4, nLineSId) + LuaCheckParam( L, 5, nLineSId) int nLineEId ; - LuaCheckParam( L, 5, nLineEId) + LuaCheckParam( L, 6, nLineEId) int nSyncLayerId ; - LuaCheckParam( L, 6, nSyncLayerId) + LuaCheckParam( L, 7, nSyncLayerId) double dThetaStart ; - LuaCheckParam( L, 7, dThetaStart) + LuaCheckParam( L, 8, dThetaStart) double dPhiStart ; - LuaCheckParam( L, 8, dPhiStart) + LuaCheckParam( L, 9, dPhiStart) double dThetaEnd ; - LuaCheckParam( L, 9, dThetaEnd) + LuaCheckParam( L, 10, dThetaEnd) double dPhiEnd ; - LuaCheckParam( L, 10, dPhiEnd) ; + LuaCheckParam( L, 11, dPhiEnd) ; double dInterpLenS ; - LuaCheckParam( L, 11, dInterpLenS) + LuaCheckParam( L, 12, dInterpLenS) double dInterpLenE ; - LuaCheckParam( L, 12, dInterpLenE) + LuaCheckParam( L, 13, dInterpLenE) double dLinTol ; - LuaCheckParam( L, 13, dLinTol) + LuaCheckParam( L, 14, 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, nSyncLayerId, nLineSId, nLineEId, + bool bOk = ExeTrimmingGetToolOrientationLines( nParentId, nMainEdgeId, nOtherEdgeId, bMainIsFirstBorder, nSyncLayerId, nLineSId, nLineEId, dThetaStart, dPhiStart, dThetaEnd, dPhiEnd, dInterpLenS, dInterpLenE, dLinTol, nInterpStartId, nStartId, nEndId, nInterpEndId) ; LuaSetParam( L, bOk) ;