From 344467a500866f45037ed7c8f7e70fa68bd7c909 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Fri, 24 Nov 2023 15:23:52 +0100 Subject: [PATCH] - In Long2Cut, in implemento Q05 come LongCut, aggiunte puliture. - In Dovetail correzione per variabile sMilling portata da globale a locale. --- LuaLibs/ProcessDovetail.lua | 2 +- LuaLibs/ProcessLongCut.lua | 2 +- LuaLibs/ProcessLongDoubleCut.lua | 51 +++++++++++++++++++++++++++----- 3 files changed, 46 insertions(+), 9 deletions(-) diff --git a/LuaLibs/ProcessDovetail.lua b/LuaLibs/ProcessDovetail.lua index ebfde81..17574e8 100644 --- a/LuaLibs/ProcessDovetail.lua +++ b/LuaLibs/ProcessDovetail.lua @@ -1684,7 +1684,7 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw, b3Sol end -- determino il massimo affondamento con l'utensile local sMchFind = 'Long2Cut' - sMilling = ML.FindMilling( sMchFind) + local sMilling = ML.FindMilling( sMchFind) if not sMilling then local sErr = 'Milling not found in library : Error on Dovetail ' .. tostring( Proc.Id) EgtOutLog( sErr) diff --git a/LuaLibs/ProcessLongCut.lua b/LuaLibs/ProcessLongCut.lua index 3112607..3571baf 100644 --- a/LuaLibs/ProcessLongCut.lua +++ b/LuaLibs/ProcessLongCut.lua @@ -656,7 +656,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus elseif ProcessLongCut.Identify( Proc) then nUseBlade = EgtGetInfo( Proc.Id, 'Q05', 'i') or 0 -- funzionamento Q05 -- - -- 0: fresa; 1: lama solo se feature passante, faccia verso l'alto; 2: lama solo se feature passante, qualunque orientamento faccia; 3: lama con feature sia cieca che passante, faccia verso l'alto; 4: lama con feature sia cieca che passante, qualunque orientamento faccia + -- 0: fresa; 1: lama solo se feature passante, faccia verso l'alto; 2: lama solo se feature passante, qualunque orientamento faccia; 3: lama con feature sia cieca che passante, faccia verso l'alto, lavorazione non rovina pezzo successivo; 4: lama con feature sia cieca che passante, qualunque orientamento faccia, lavorazione non rovina pezzo successivo end local bForceUseBladeOnNotThruFace if nCustForceUseBladeOnNCF then diff --git a/LuaLibs/ProcessLongDoubleCut.lua b/LuaLibs/ProcessLongDoubleCut.lua index 7771858..6303a1a 100644 --- a/LuaLibs/ProcessLongDoubleCut.lua +++ b/LuaLibs/ProcessLongDoubleCut.lua @@ -20,6 +20,7 @@ -- 2023/06/07 Sistemazione SCC per macchina TURN -- 2023/10/24 Migliorata spezzatura taglio passante con due spezzoni -- 2023/10/25 Se effettivamente un taglio longitudinale e lama non taglia completamente, limito la lavorazione. Altrimenti esco. +-- 2023/11/24 Aggiunta Q05 per utilizzo lama anche in feature cieche conme per LongCut. -- Tabella per definizione modulo local ProcessLong2Cut = {} @@ -374,7 +375,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster else local nUseBlade = EgtGetInfo( Proc.Id, 'Q05', 'i') -- funzionamento Q05 -- - -- 0: fresa; 1: lama solo se feature passante, faccia verso l'alto; 2: lama solo se feature passante, qualunque orientamento faccia; 3: lama con feature sia cieca che passante, faccia verso l'alto; 4: lama con feature sia cieca che passante, qualunque orientamento faccia + -- 0: fresa; 1: lama solo se feature passante, faccia verso l'alto; 2: lama solo se feature passante, qualunque orientamento faccia; 3: lama con feature sia cieca che passante, faccia verso l'alto, lavorazione non rovina pezzo successivo; 4: lama con feature sia cieca che passante, qualunque orientamento faccia, lavorazione non rovina pezzo successivo -- feature passante if nFaceLimit == 0 then if nUseBlade == 2 or nUseBlade == 4 or @@ -629,7 +630,6 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster end -- ricavo informazioni della faccia local b3Fac = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vOrd[j]-1, GDB_BB.STANDARD) - local _, _, dWidth = EgtSurfTmFacetMinAreaRectangle( Proc.Id, 0, GDB_ID.ROOT) -- determino accorciamenti se lavorazione cieca if bForceUseBladeOnNotThruFace then if bCanUseBlade then @@ -637,14 +637,15 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster -- limitato a destra if ( nFaceLimit & 1) ~= 0 then local dRadius = dToolDiam / 2 - local dCat1 = dRadius - ( ( dWidth - dDimStrip) / 2) + local dCat1 = dRadius - dOffset + dStartDistUp = sqrt( ( dRadius * dRadius) - (dCat1 * dCat1)) bStartFixed = false end bEndFixed = true -- limitato a sinistra if ( nFaceLimit & 2) ~= 0 then local dRadius = dToolDiam / 2 - local dCat1 = dRadius - ( ( dWidth - dDimStrip) / 2) + local dCat1 = dRadius - dOffset dEndDistUp = sqrt( ( dRadius * dRadius) - (dCat1 * dCat1)) bEndFixed = false end @@ -654,7 +655,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster -- limitato a destra if ( nFaceLimit & 1) ~= 0 then local dRadius = dToolDiamDn / 2 - local dCat1 = dRadius - ( ( dWidth - dDimStrip) / 2) + local dCat1 = dRadius - dOffset dStartDistDn = sqrt( ( dRadius * dRadius) - (dCat1 * dCat1)) bStartFixed = false end @@ -662,7 +663,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster -- limitato a sinistra if ( nFaceLimit & 2) ~= 0 then local dRadius = dToolDiamDn / 2 - local dCat1 = dRadius - ( ( dWidth - dDimStrip) / 2) + local dCat1 = dRadius - dOffset dEndDistDn = sqrt( ( dRadius * dRadius) - (dCat1 * dCat1)) bEndFixed = false end @@ -895,7 +896,43 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster end end end - + end + end + -- eventuali puliture impronta lama + for j = 1, #vOrd do + if bForceUseBladeOnNotThruFace then + -- determino la massima elevazione + local dElev = 0 + local dFacElev1 = EgtSurfTmFacetElevationInBBox( Proc.Id, tFaceLong[1], b3Solid, GDB_ID.ROOT) + local dFacElev2 = EgtSurfTmFacetElevationInBBox( Proc.Id, tFaceLong[2], b3Solid, GDB_ID.ROOT) + dElev = max( dFacElev1, dFacElev2) + -- recupero la lavorazione + local sMilling + local bDownHead = ( nSide == -1 and BD.DOWN_HEAD) + sMilling = ML.FindMilling( 'Long2Cut', dElev, nil, nil, nil, not bDownHead, bDownHead) + if not sMilling then + local sErr = 'Error : Long2Cut not found in library' + EgtOutLog( sErr) + return false, sErr + end + -- recupero i dati dell'utensile + local dToolDiam = 0 + local dMaxDepth = 0 + if EgtMdbSetCurrMachining( sMilling) then + local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) + if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then + dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiam + dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth + end + end + -- eventuale lavorazione della faccia limitante l'inizio (a destra) + if not bStartFixed then + MakeSideFace( Proc.Id, tFaceLong[vOrd[j]], 1, j, sMilling, dToolDiam, nSide, bIsAnyFaceUpsideDown) + end + -- eventuale lavorazione della faccia limitante la fine (a sinistra) + if not bEndFixed then + MakeSideFace( Proc.Id, tFaceLong[vOrd[j]], -1, j, sMilling, dToolDiam, nSide, bIsAnyFaceUpsideDown) + end end end -- altrimenti concavo