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 9af60f7..3571baf 100644 --- a/LuaLibs/ProcessLongCut.lua +++ b/LuaLibs/ProcessLongCut.lua @@ -655,6 +655,8 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus -- leggo il parametro Q05 solo se è una vera longcut L010 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, 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 937afab..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 = {} @@ -367,11 +368,28 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster ---------------------------------------------------------------------------------------------------------------------------------------- local bUseBlade local nUseMillOnSide + local bForceUseBladeOnNotThruFace -- se presenti utilizzo i parametri dell'eventuale lua "padre" if bForcedBladeMaster ~= nil then bUseBlade = bForcedBladeMaster else - bUseBlade = EgtGetInfo( Proc.Id, 'Q01', 'i') == 1 + 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, 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 + ( nSide == 1 and ( nUseBlade == 1 or nUseBlade == 3)) then + bUseBlade = true + end + -- feature cieca + else + if nUseBlade == 4 or + ( nSide == 1 and ( nUseBlade == 3)) then + bUseBlade = true + bForceUseBladeOnNotThruFace = true + end + end end if nUseSideToolMaster ~= nil then nUseMillOnSide = nUseSideToolMaster @@ -418,8 +436,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster _, _, vWidth[1] = BL.GetFaceHvRefDim( Proc.Id, tFaceLong[1]) _, _, vWidth[2] = BL.GetFaceHvRefDim( Proc.Id, tFaceLong[2]) - -- Se senza facce limitanti, da sopra o ( da tutte i lati con testa da sotto) e taglio di lama e lunghezza facce maggiore del parametro lunghezza minima - if nFaceLimit == 0 and ( bCanUseUnderBlade or bCanUseBlade) and bUseBlade and Proc.Box:getDimX() > dLimMinPiece - 1 then + -- Se da sopra o ( da tutte i lati con testa da sotto) e taglio di lama e lunghezza facce maggiore del parametro lunghezza minima + if ( bCanUseUnderBlade or bCanUseBlade) and bUseBlade and Proc.Box:getDimX() > dLimMinPiece - 1 then local sCutting local dToolDiam = 0 @@ -465,23 +483,36 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster end end end - -- se la distanza dal pezzo successivo è inferiore della metà lama, do un warning - if ( bCanUseBlade or bCanUseUnderBlade) and ( dDistToNextPiece < dToolDiam/2 or dDistToNextPiece < dToolDiamDn/2) then - sWarn = 'Warning : Cut machining can damage next piece' - EgtOutLog( sWarn) + -- se la fine (a sinistra) non è limitata e ho un pezzo successivo o grezzo riutilizzabile meno distante di metà raggio, setto la fine come limitata + if (( bCanUseBlade or bCanUseUnderBlade) and ( dDistToNextPiece < dToolDiam/2 or dDistToNextPiece < dToolDiamDn/2)) and nFaceLimit < 2 then + if bForceUseBladeOnNotThruFace then + nFaceLimit = nFaceLimit | 2 + bForcedLim = true + else + sWarn = 'Warning on saw cut : Cut machining can damage next piece' + EgtOutLog( sWarn) + end end -- determino gli estremi local dStartAccDist local dEndAccDist + local bStartFixed + local bEndFixed + local dStartDist + local dEndDist + local dStartDistUp = 0 + local dEndDistUp = 0 + local dStartDistDn = 0 + local dEndDistDn = 0 local dStartAccDistUp = BD.LONGCUT_ENDLEN local dEndAccDistUp = BD.LONGCUT_ENDLEN local dStartAccDistDn = BD.LONGCUT_ENDLEN local dEndAccDistDn = BD.LONGCUT_ENDLEN local nC - local dC - + local dC local nCUp local dCUp + -- determino numero di parti if bCanUseBlade then nCUp = ceil( ( dLen - dStartAccDistUp - dEndAccDistUp) / BD.LONGCUT_MAXLEN) @@ -569,7 +600,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster EgtOutLog( sErr) return false, sErr end - local nFaceUse + local nFaceUse local nFaceUse2 -- se ho solo lama da sotto if bCanUseUnderBlade and not bCanUseBlade then @@ -597,8 +628,47 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster elseif vtN[vOrd[j]]:getZ() < -0.707 then nFaceSide = -1 end - -- ricavo box della faccia + -- ricavo informazioni della faccia local b3Fac = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vOrd[j]-1, GDB_BB.STANDARD) + -- determino accorciamenti se lavorazione cieca + if bForceUseBladeOnNotThruFace then + if bCanUseBlade then + bStartFixed = true + -- limitato a destra + if ( nFaceLimit & 1) ~= 0 then + local dRadius = dToolDiam / 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 - dOffset + dEndDistUp = sqrt( ( dRadius * dRadius) - (dCat1 * dCat1)) + bEndFixed = false + end + end + if bCanUseUnderBlade then + bStartFixed = true + -- limitato a destra + if ( nFaceLimit & 1) ~= 0 then + local dRadius = dToolDiamDn / 2 + local dCat1 = dRadius - dOffset + dStartDistDn = sqrt( ( dRadius * dRadius) - (dCat1 * dCat1)) + bStartFixed = false + end + bEndFixed = true + -- limitato a sinistra + if ( nFaceLimit & 2) ~= 0 then + local dRadius = dToolDiamDn / 2 + local dCat1 = dRadius - dOffset + dEndDistDn = sqrt( ( dRadius * dRadius) - (dCat1 * dCat1)) + bEndFixed = false + end + end + end -- ciclo sulle passate for k = 1, 2 do local dLioPerp = ( vWidth[vOrd[j]] - dDimStrip) / 2 + BD.CUT_SIC @@ -615,6 +685,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster -- setto le variabili delle distanze dagli estremi dEndAccDist = dEndAccDistUp dStartAccDist = dStartAccDistUp + dStartDist = dStartDistUp + dEndDist = dEndDistUp elseif bCanUseUnderBlade and not bCanUseBlade then sNameF = 'L2CD_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring(j) .. '_' .. tostring( nM) nMchFId = EgtAddMachining( sNameF, sCuttingDn) @@ -622,6 +694,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster -- setto le variabili delle distanze dagli estremi dEndAccDist = dEndAccDistDn dStartAccDist = dStartAccDistDn + dStartDist = dStartDistDn + dEndDist = dEndDistDn bMachDown = true -- entrambe le possibilità di lama else @@ -634,6 +708,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster -- setto le variabili delle distanze dagli estremi dEndAccDist = dEndAccDistDn dStartAccDist = dStartAccDistDn + dStartDist = dStartDistDn + dEndDist = dEndDistDn bMachDown = true -- se di fronte e prima faccia o dietro e seconda faccia, sta lavorando quella più in basso in Z (posizione) elseif ( ( bFront and j == 1) or ( not bFront and j == 2)) and k == 2 then @@ -643,6 +719,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster -- setto le variabili delle distanze dagli estremi dEndAccDist = dEndAccDistDn dStartAccDist = dStartAccDistDn + dStartDist = dStartDistDn + dEndDist = dEndDistDn bMachDown = true -- se di fronte e seconda faccia o dietro e prima faccia, sta lavorando la faccia più in alto in Z (posizione) elseif ( ( bFront and j == 2) or ( not bFront and j == 1)) and k == 1 then @@ -652,6 +730,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster -- setto le variabili delle distanze dagli estremi dEndAccDist = dEndAccDistUp dStartAccDist = dStartAccDistUp + dStartDist = dStartDistUp + dEndDist = dEndDistUp -- se di fronte e seconda faccia o dietro e prima faccia, sta lavorando la faccia più in alto in Z (posizione) elseif ( ( bFront and j == 2) or ( not bFront and j == 1)) and k == 2 then sNameF = 'L2C_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring(j) .. '_' .. tostring( nM) @@ -660,6 +740,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster -- setto le variabili delle distanze dagli estremi dEndAccDist = dEndAccDistUp dStartAccDist = dStartAccDistUp + dStartDist = dStartDistUp + dEndDist = dEndDistUp end end if not nMchFId then @@ -707,8 +789,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster -- settaggio di workside, uso faccia e eventuale inversione -- limito opportunamente la lavorazione - local dSalInner, dSalOuter = - dEndAccDist - ( i - 2) * dC, 0 - local dEalInner, dEalOuter = - dStartAccDist - ( nC - i - 1) * dC, 0 + local dSalInner, dSalOuter = - dEndAccDist - ( i - 2) * dC, -dEndDist + local dEalInner, dEalOuter = - dStartAccDist - ( nC - i - 1) * dC, -dStartDist local dSal = EgtIf( i == 1, dSalOuter, dSalInner) local dEal = EgtIf( i == nC, dEalOuter, dEalInner) if ( bFront and k == 1) or ( not bFront and k == 2) then @@ -816,6 +898,43 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster 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 else -- se effettivamente un taglio longitudinale e lama non taglia completamente, limito la lavorazione. Altrimenti esco. diff --git a/UpdateLog.txt b/UpdateLog.txt index 3163608..4ddcc39 100644 --- a/UpdateLog.txt +++ b/UpdateLog.txt @@ -1,14 +1,17 @@ ==== Beam Update Log ==== +Versione 2.5k3 (28/11/2023) +- Added : in Long2Cut gestite lavorazioni lama con Q05 come in LongCut. + Versione 2.5k2 (06/11/2023) -- Added : in LapJoint, per L020, gestita lavorazione speciale gradino scala con fresatura + lama, attivata con Q09. -- Fixed : in ProcessSplit si imposta l'ingombro asse C correttamente anche per teste con asse rotante C con un solo braccio +- Added : in LapJoint, per L020, gestita lavorazione speciale gradino scala con fresatura + lama, attivata con Q09 +- Fixed : in ProcessSplit si imposta l'ingombro asse C correttamente anche per teste con asse rotante C con un solo braccio. Versione 2.5k1 (02/11/2023) - Modif : in LapJoint gestito caso groove due facce >90° con fresa, se forzato da parametro Q - Modif : in LongCut e LongDoubleCut migliorata spezzatura taglio passante con due spezzoni - Modif : nei tagli di lama migliorata gestione con percorso bilinea -- Modif : in LapJoint 2 facce longitudinali si usa taglio di lama solo se si taglia completamente, altrimenti fresa +- Modif : in LapJoint 2 facce longitudinali si usa taglio di lama solo se si taglia completamente, altrimenti fresa. Versione 2.5j1 (23/10/2023) - Added : in Process (lancio da EgtCAM5 quindi uso praticamente solo interno) aggiunta possibilità di tenere ordine pezzi in barra come da selezione @@ -16,7 +19,7 @@ Versione 2.5j1 (23/10/2023) - Fixed : in HeadCut e Split corretto calcolo allungamenti/accorciamenti per evitare lunghezze del percorso negative - Fixed : in Lapjoint -> MakePocket aggiunto messaggio in caso si rovini il pezzo successivo - Modif : in Topology aggiunti casi al check solo direzione principale -- Modif : nella ricerca lavorazione da usare controllo di utensile attivo sostituito con controllo utensile presente nel setup corrente +- Modif : nella ricerca lavorazione da usare controllo di utensile attivo sostituito con controllo utensile presente nel setup corrente. Versione 2.5i2 (27/09/2023) - Added : aggiunto riconoscimento sottosquadro da facce non adiacenti diff --git a/Version.lua b/Version.lua index fa56dd5..dd88d5b 100644 --- a/Version.lua +++ b/Version.lua @@ -2,5 +2,5 @@ -- Gestione della versione di Beam NAME = 'Beam' -VERSION = '2.5k4' +VERSION = '2.5k5' MIN_EXE = '2.5c1'