From b3109756e4ab6194884e86154121bb5144bccd59 Mon Sep 17 00:00:00 2001 From: DarioS Date: Fri, 5 Nov 2021 08:23:53 +0100 Subject: [PATCH] DataBeam : - migliorato calcolo tagli di lama su faccia con due lati da considerare - migliorato calcolo sicurezza utensile di fianco su taglio longitudinale singolo. --- LuaLibs/BeamLib.lua | 4 +++- LuaLibs/ProcessLongCut.lua | 25 +++++++++++++++++++------ LuaLibs/ProcessLongDoubleCut.lua | 4 ++-- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/LuaLibs/BeamLib.lua b/LuaLibs/BeamLib.lua index 2794704..4889987 100644 --- a/LuaLibs/BeamLib.lua +++ b/LuaLibs/BeamLib.lua @@ -894,7 +894,9 @@ function BeamLib.MakeOneFaceBySaw( nSurfId, nFacet, sCutting, dSawDiam, Par5, dV local dLenMax = max( 0.5 * dSawDiam * 0.17365 + 1, 2 * dLenMin) --if vtTg1 * vtTg2 < dCosMax or ( dDist1 < dLenMax and dDist1 > dLenMin) or ( dDist2 < dLenMax and dDist2 > dLenMin) then if vtTg1 * vtTg2 < dCosMax then - if abs( vtTg1 * vtOrthO) < abs( vtTg2 * vtOrthO) then + local dOrtho1 = abs( vtTg1 * vtOrthO) + local dOrtho2 = abs( vtTg2 * vtOrthO) + if dOrtho1 < dOrtho2 or ( abs( dOrtho1 - dOrtho2) < 0.1 and dDist1 > 4 * dDist2) then if dDist1 > dLenMin or dDist1 > 0.5 * dDist2 then ptP2 = Point3d( ptPm) dAllEnd = - dDist2 - 10 * GEO.EPS_SMALL diff --git a/LuaLibs/ProcessLongCut.lua b/LuaLibs/ProcessLongCut.lua index 760a205..9dc538f 100644 --- a/LuaLibs/ProcessLongCut.lua +++ b/LuaLibs/ProcessLongCut.lua @@ -1,4 +1,4 @@ --- ProcessLongCut.lua by Egaltech s.r.l. 2021/10/29 +-- ProcessLongCut.lua by Egaltech s.r.l. 2021/11/04 -- Gestione calcolo taglio longitudinale per Travi -- 2021/02/03 Corretto FaceUse con fresa orizzontale su taglio orizzontale. -- 2021/05/18 Possibile taglio con lama anche di fianco su macchina con testa da sotto. @@ -7,6 +7,7 @@ -- รจ possibile fare doppio taglio opposto su tutte le facce(sopra, sotto e fianchi) -- 2021/09/03 Gestione facce lunghe non passanti con taglio di lama -- 2021/10/29 Aggiunta opzione tipo lavorazione 'LongCut'. +-- 2021/11/04 Migliorata gestione sicurezza aggiuntiva in fresate di fianco (distinzione tra larga come tutta la faccia o meno). -- Tabella per definizione modulo local ProcessLongCut = {} @@ -361,6 +362,13 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus elseif vtN:getY() > 0.7072 then nSide = 2 end + -- Verifico se largo come faccia + local bLarghAsFace = false + if nSide == 1 or nSide == -1 then + bLarghAsFace = ( Proc.Box:getDimY() > b3Solid:getDimY() - 10) + else + bLarghAsFace = ( Proc.Box:getDimZ() > b3Solid:getDimZ() - 10) + end -- determino se lavorazione da davanti o da dietro local bFront = ( vtN:getY() < 0) -- ottengo la distanza tra la fine del pezzo e il pezzo successivo @@ -1259,8 +1267,11 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus dSicOnLegth = dExtraForSafety / 2 end dCollSicMin = max( BD.COLL_SIC, ( dThDiam - dToolDiam) / 2 * abs( EgtIf( abs(vtN:getY()) >= abs(vtN:getZ()), vtN:getZ(), vtN:getY()) / dNzMin)) --- dCollSic = max( BD.COLL_SIC, dSicOnRad * EgtIf( abs(dNz) < GEO.EPS_SMALL, 1, abs( EgtIf( abs(nSide) == 1, vtN:getZ(), vtN:getY()) / dNz)) + dSicOnLegth) - dCollSic = max( BD.COLL_SIC, dSicOnRad * abs( EgtIf( abs(vtN:getY()) >= abs(vtN:getZ()), vtN:getZ(), vtN:getY()) / dNzMin) + dSicOnLegth) + if bLarghAsFace then + dCollSic = max( BD.COLL_SIC, dSicOnRad * abs( EgtIf( abs(vtN:getY()) >= abs(vtN:getZ()), vtN:getZ(), vtN:getY()) / dNzMin) + dSicOnLegth) + else + dCollSic = max( BD.COLL_SIC, dSicOnRad * EgtIf( abs(dNz) < GEO.EPS_SMALL, 1, abs( EgtIf( abs(nSide) == 1, vtN:getZ(), vtN:getY()) / dNz)) + dSicOnLegth) + end if nSide ~= 1 and BD.DOWN_HEAD then local dSicOnRadDn local dSicOnLegthDn @@ -1272,9 +1283,11 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus dSicOnLegthDn = dExtraForSafety / 2 end dCollSicMinDn = max( BD.COLL_SIC, ( dThDiamDn - dToolDiamDn) / 2 * abs( EgtIf( abs(vtN:getY()) >= abs(vtN:getZ()), vtN:getZ(), vtN:getY()) / dNzMin)) --- dCollSicDn = max( BD.COLL_SIC, dSicOnRadDn * EgtIf( abs(dNz) < GEO.EPS_SMALL, 1, abs( EgtIf( abs(nSide) == 1, vtN:getZ(), vtN:getY()) / dNz)) + dSicOnLegthDn) - dCollSicDn = max( BD.COLL_SIC, dSicOnRadDn * abs( EgtIf( abs(vtN:getY()) >= abs(vtN:getZ()), vtN:getZ(), vtN:getY()) / dNzMin) + dSicOnLegthDn) - + if bLarghAsFace then + dCollSicDn = max( BD.COLL_SIC, dSicOnRadDn * abs( EgtIf( abs(vtN:getY()) >= abs(vtN:getZ()), vtN:getZ(), vtN:getY()) / dNzMin) + dSicOnLegthDn) + else + dCollSicDn = max( BD.COLL_SIC, dSicOnRadDn * EgtIf( abs(dNz) < GEO.EPS_SMALL, 1, abs( EgtIf( abs(nSide) == 1, vtN:getZ(), vtN:getY()) / dNz)) + dSicOnLegthDn) + end if dWidth + dAgg > dMaxDepth - dCollSic then nPass = 2 dAgg = 1 diff --git a/LuaLibs/ProcessLongDoubleCut.lua b/LuaLibs/ProcessLongDoubleCut.lua index 7bfde53..e8c1a93 100644 --- a/LuaLibs/ProcessLongDoubleCut.lua +++ b/LuaLibs/ProcessLongDoubleCut.lua @@ -289,9 +289,9 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster -- verifico posizione (+1=sopra, -1=sotto, 0=sui lati) local nSide = 0 - if vtN[1]:getZ() > 10 * GEO.EPS_SMALL and vtN[2]:getZ() > 10 * GEO.EPS_SMALL then + if vtN[1]:getZ() > -10 * GEO.EPS_SMALL and vtN[2]:getZ() > -10 * GEO.EPS_SMALL then nSide = 1 - elseif vtN[1]:getZ() < -10 * GEO.EPS_SMALL and vtN[2]:getZ() < -10 * GEO.EPS_SMALL then + elseif vtN[1]:getZ() < 10 * GEO.EPS_SMALL and vtN[2]:getZ() < 10 * GEO.EPS_SMALL then nSide = -1 end