From 003fef5a6d7770e5edb3acb633a790a7cfafa17e Mon Sep 17 00:00:00 2001 From: DarioS Date: Tue, 8 Feb 2022 18:38:12 +0100 Subject: [PATCH] =?UTF-8?q?DataBeam=20:=20-=20in=20Process=20Cut=20aumenta?= =?UTF-8?q?to=20angolo=20da=20sotto=20con=20FAST=20-=20in=20Process=20LapJ?= =?UTF-8?q?oint=20corretto=20caso=20con=20due=20facce=20che=20non=20=C3=A8?= =?UTF-8?q?=20un=20LongDoubleCut=20ma=20che=20veniva=20identificato=20come?= =?UTF-8?q?=20tale=20-=20in=20Process=20LongDoubleCut=20migliorato=20contr?= =?UTF-8?q?ollo=20lunghezze=20di=20lavorazione=20con=20fresa=20quando=20di?= =?UTF-8?q?visa=20in=20due=20parti.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/ProcessCut.lua | 2 +- LuaLibs/ProcessLapJoint.lua | 12 ++++++---- LuaLibs/ProcessLongDoubleCut.lua | 38 ++++++++++++++++++++++++-------- 3 files changed, 38 insertions(+), 14 deletions(-) diff --git a/LuaLibs/ProcessCut.lua b/LuaLibs/ProcessCut.lua index 05d1457..8774ec9 100644 --- a/LuaLibs/ProcessCut.lua +++ b/LuaLibs/ProcessCut.lua @@ -236,7 +236,7 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT) -- limiti di taglio (se molto di lato e inclinati sono permessi fino a -45deg) local dNzLimDwnUp = BL.GetNzLimDownUp( b3Raw) - if not BD.C_SIMM and abs( vtN:getX()) < 0.5 then dNzLimDwnUp = -0.707 end + if not BD.C_SIMM and abs( vtN:getY()) > 0.25 then dNzLimDwnUp = -0.708 end local bDownCut = ( vtN:getZ() <= dNzLimDwnUp) if bFromBottom == nil then bFromBottom = ( vtN:getZ() > 0.25 and b3Solid:getDimX() < BD.LEN_SHORT_PART and not Proc.AdvTail and vtN:getX() < 0) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 0219e0a..9b9f757 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -1,4 +1,4 @@ --- ProcessLapJoint.lua by Egaltech s.r.l. 2022/01/26 +-- ProcessLapJoint.lua by Egaltech s.r.l. 2022/02/07 -- Gestione calcolo mezzo-legno per Travi -- 2019/10/08 Agg. gestione OpenPocket. -- 2021/01/24 Con sega a catena ora sempre impostato asse A. @@ -34,6 +34,7 @@ -- 2021/11/22 Corretta segnalazione warning su foro di L20 e L25. -- 2022/01/19 Cambiata % lunghezza pezzo per spezzatura. Tolta correzione spessore fresa a disco con superficie da lavorare verso Z-. -- 2022/01/26 Migliorato controllo uso testa da sotto nel caso due facce con lama. +-- 2022/02/07 Corretto caso con due facce che non è un LongDoubleCut ma che veniva identificato come tale. -- Tabella per definizione modulo local ProcessLapJoint = {} @@ -5426,7 +5427,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) -- determino se due facce lunghe oppure una lunga e l'altra terminale local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, 0, GDB_BB.STANDARD) local b3Fac2 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, 1, GDB_BB.STANDARD) - if abs( b3Fac1:getDimX() - b3Fac2:getDimX()) < 50 then + if abs( b3Fac1:getDimX() - b3Fac2:getDimX()) < 50 and abs( b3Fac1:getCenter():getX() - b3Fac2:getCenter():getX()) < 50 then -- leggo i parametri Q per utilizzare la fresa di fianco e/o lama local nUseSideTool = EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') or 0 local bUseBlade = EgtGetInfo( Proc.Id, Q_ANTISPLINT_TYPE, 'i') == 1 @@ -5502,8 +5503,11 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) end -- due facce elseif Proc.Fct == 2 then - -- se praticamente è lunga come la trave - if Proc.Box:getDimX() > 0.8 * b3Solid:getDimX() then + -- se praticamente è lunga come la trave e sono due facce lunghe + local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, 0, GDB_BB.STANDARD) + local b3Fac2 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, 1, GDB_BB.STANDARD) + if Proc.Box:getDimX() > 0.8 * b3Solid:getDimX() and + abs( b3Fac1:getDimX() - b3Fac2:getDimX()) < 50 and abs( b3Fac1:getCenter():getX() - b3Fac2:getCenter():getX()) < 50 then local nUseSideTool = EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') or 0 return Long2Cut.Make( Proc, nPhase, nRawId, nPartId, bUseBlade, nUseSideTool) -- altrimenti diff --git a/LuaLibs/ProcessLongDoubleCut.lua b/LuaLibs/ProcessLongDoubleCut.lua index f3bec51..80202c3 100644 --- a/LuaLibs/ProcessLongDoubleCut.lua +++ b/LuaLibs/ProcessLongDoubleCut.lua @@ -1,9 +1,10 @@ --- ProcessLongDoubleCut.lua by Egaltech s.r.l. 2021/11/08 +-- ProcessLongDoubleCut.lua by Egaltech s.r.l. 2022/02/08 -- Gestione calcolo doppio taglio longitudinale per Travi -- 2021/05/18 Possibile taglio con lama anche di fianco su macchina con testa da sotto. -- 2021/06/29 Corretta gestione caso equivalente a due smussi. -- 2021/10/29 Aggiunta opzione tipo lavorazione 'LongCut'. -- 2021/11/08 Se con lama e flag BD.USE_LONGCUT si lavora in direzione contraria allo standard. +-- 2022/02/08 Sistemate lunghezze fresature quando due sole. -- Tabella per definizione modulo local ProcessLong2Cut = {} @@ -381,7 +382,6 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster end -- 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 ( nSide == 1 or ( abs(nSide) >= 0 and BD.DOWN_HEAD)) and bUseBlade and Proc.Box:getDimX() > dLimMinPiece - 1 then if nFaceLimit == 0 and ( bCanUseUnderBlade or bCanUseBlade) and bUseBlade and Proc.Box:getDimX() > dLimMinPiece - 1 then local sCutting @@ -503,8 +503,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster dC = dCDn end - -- disabilitato la selezione del codolo, prende sempre quello più piccolo. Non cancellare quello disabiliato in caso di ripristino --- local dDimStrip = EgtIf( nSide ~= 0, BD.DIM_STRIP_SMALL, BD.DIM_STRIP) + -- uso codolo piccolo local dDimStrip = BD.DIM_STRIP_SMALL * EgtIf( nSide == -1, -1, 1) local nM = 0 -- se convesso lavoro ogni faccia in due metà lasciando attaccata la parte centrale @@ -572,7 +571,6 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster local nMchFId local sCuttingName local bMachDown --- if ( k == 1 and bCanUseBlade) or ( k == 2 and ( bCanUseBlade and not bCanUseUnderBlade)) then if bCanUseBlade and not bCanUseUnderBlade then sNameF = 'L2C_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring(j) .. '_' .. tostring( nM) nMchFId = EgtAddMachining( sNameF, sCutting) @@ -580,7 +578,6 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster -- setto le variabili delle distanze dagli estremi dEndAccDist = dEndAccDistUp dStartAccDist = dStartAccDistUp --- elseif ( k == 2 and bCanUseUnderBlade) or ( k == 1 and ( bCanUseUnderBlade and not bCanUseBlade)) then elseif bCanUseUnderBlade and not bCanUseBlade then sNameF = 'L2CD_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring(j) .. '_' .. tostring( nM) nMchFId = EgtAddMachining( sNameF, sCuttingDn) @@ -947,10 +944,10 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster local nIncStep = 2 if bStartFixed and bEndFixed then dC = ( dLen - dStartAccDist - dEndAccDist) / nC - -- se distanza rimanente è < della metà del minimo della distanza estremi allora aggiungo un passo in più + -- se distanza rimanente è < della metà del minimo della distanza estremi allora aggiungo un solo passo in più local dMinDist = EgtIf( min( dStartAccDist, dEndAccDist) / 2 > 300 , 300, min( dStartAccDist, dEndAccDist) / 2) if dC < dMinDist then - dC = dLen / ( nC + 2) + dC = dLen / ( nC + 1) dStartAccDist = dC dEndAccDist = dC nIncStep = 1 @@ -1263,20 +1260,43 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster local nC = ceil( ( dLen - dStartAccDist - dEndAccDist) / BD.LONGCUT_MAXLEN) local dC = 0 if nC > 0 then + local nIncStep = 2 if bStartFixed and bEndFixed then dC = ( dLen - dStartAccDist - dEndAccDist) / nC + -- se distanza rimanente è < della metà del minimo della distanza estremi allora aggiungo un solo passo in più + local dMinDist = EgtIf( min( dStartAccDist, dEndAccDist) / 2 > 300 , 300, min( dStartAccDist, dEndAccDist) / 2) + if dC < dMinDist then + dC = dLen / ( nC + 1) + dStartAccDist = dC + dEndAccDist = dC + nIncStep = 1 + elseif dC < min( dStartAccDist, dEndAccDist) then + dC = dLen / ( nC + 2) + dStartAccDist = dC + dEndAccDist = dC + end elseif bStartFixed then dC = ( dLen - dStartAccDist) / ( nC + 1) dEndAccDist = dC + if dC < dStartAccDist then + dC = dLen / ( nC + 2) + dStartAccDist = dC + dEndAccDist = dC + end elseif bEndFixed then dC = ( dLen - dEndAccDist) / ( nC + 1) dStartAccDist = dC + if dC < dEndAccDist then + dC = dLen / ( nC + 2) + dStartAccDist = dC + dEndAccDist = dC + end else dC = dLen / ( nC + 2) dStartAccDist = dC dEndAccDist = dC end - nC = nC + 2 + nC = nC + nIncStep else if dLen > min( dStartAccDist, dEndAccDist) then nC = 2