diff --git a/LuaLibs/BeamLib.lua b/LuaLibs/BeamLib.lua index c8e5360..76f8177 100644 --- a/LuaLibs/BeamLib.lua +++ b/LuaLibs/BeamLib.lua @@ -688,7 +688,7 @@ function BeamLib.GetNzLimDownUp( b3Raw, vtN, vtOrtho) return EgtIf( b3Raw:getDimZ() < BD.MIN_DIM_HBEAM, -0.609, -0.383) end else - if vtN and ( abs( vtN:getY()) > 0.49) then + if vtN and ( abs( vtN:getY()) > 0.866) then return -0.708 else return EgtIf( b3Raw:getDimZ() < 200, -0.5, -0.258) diff --git a/LuaLibs/ProcessCut.lua b/LuaLibs/ProcessCut.lua index 535bd41..03e7bf4 100644 --- a/LuaLibs/ProcessCut.lua +++ b/LuaLibs/ProcessCut.lua @@ -715,9 +715,9 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, return true end -- abilitazione lavorazione da sotto (testa da sotto e direzione normale sotto -20deg e sbandato oltre 1deg oppure sezione larga o pezzo corto) - local bTopHead = ( BD.DOWN_HEAD and vtN:getZ() > -0.342) local bDownHead = ( BD.DOWN_HEAD and vtN:getZ() < -0.341 and ( abs( vtN:getY()) > 0.017 or b3Raw:getDimY() > 2 * ( BD.MAX_DIM_HTCUT - BD.CUT_EXTRA_MIN) or b3Raw:getDimX() < BD.LEN_SHORT_PART)) + local bTopHead = ( BD.DOWN_HEAD and ( vtN:getZ() > -0.342 or not bDownHead)) -- recupero la lavorazione local sCutType = EgtIf( Proc.Head, 'HeadSide', 'TailSide') local sCutting = ML.FindCutting( sCutType .. EgtIf( bDownHead, '_H2', '')) diff --git a/LuaLibs/ProcessDrill.lua b/LuaLibs/ProcessDrill.lua index 8af3eeb..132af73 100644 --- a/LuaLibs/ProcessDrill.lua +++ b/LuaLibs/ProcessDrill.lua @@ -1,9 +1,10 @@ --- ProcessDrill.lua by Egaltech s.r.l. 2021/10/29 +-- ProcessDrill.lua by Egaltech s.r.l. 2022/03/26 -- Gestione calcolo forature per Travi -- 2021/04/14 DS Corretta gestione Invert con testa da sotto. Migliorato calcolo ingombro portautensile. -- 2021/05/03 DS Su macchina con testa da sotto aggiunta possibilità di fare fori verticali metà sopra e l'altra sotto. -- 2021/09/19 DS Si premia il più possibile ricerca punta con adeguato affondamento. -- 2021/10/29 DS MaxElev anche su fori con svuotatura. +-- 2022/03/26 DS Correzioni per fori testa-fianco nel piano. -- Tabella per definizione modulo local ProcessDrill = {} @@ -190,8 +191,10 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) EgtOutLog( sErr) return false, sErr end - -- se il foro è cieco all'inizio, lo inverto - if Proc.Fcs == 0 then bToInvert = true end + -- se il foro è cieco o troppo inclinato all'inizio, lo inverto + if Proc.Fcs == 0 or ( abs( vtExtr:getX()) > BD.DRILL_VX_MAX and Proc.Fcs ~= 5 and Proc.Fcs ~= 6) then + bToInvert = true + end if bToInvert then vtExtr = - vtExtr end -- se foro è splittato ed è la parte opposta, inverto if Proc.Flg == -2 then bToInvert = true end @@ -322,11 +325,12 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) EgtOutLog( sErr) return false, sErr end + -- verifico il massimo affondamento local dSubL1 = 0 local dSubL2 = 0 local dSubL3 = 0 local dDeltaRad = ( Proc.Diam - dToolDiam) / 2 - -- se foro non su testa o coda e inclinato, limito il massimo affondamento + -- se foro non su testa o coda e inclinato local bInMid = false local bInvertFcse = ( bToInvert and Proc.Flg ~= -2) if ( not bInvertFcse and Proc.Fcs ~= 5 and Proc.Fcs ~= 6) or ( bInvertFcse and Proc.Fce ~= 5 and Proc.Fce ~= 6) then @@ -339,9 +343,9 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) dMaxDepth = 0 end end - -- se foro davanti o dietro e inclinato, limito il massimo affondamento + -- se foro davanti o dietro e inclinato if dMaxDepth > 0 and abs( vtExtr:getY()) > abs( vtExtr:getZ()) then - local CosB = abs( vtExtr:getZ()) + local CosB = abs( vtExtr:getY()) if bInMid then CosB = sqrt( vtExtr:getZ() * vtExtr:getZ() + vtExtr:getX() * vtExtr:getX()) end @@ -352,9 +356,9 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) dMaxDepth = 0 end end - -- se foro sopra o sotto e inclinato, limito il massimo affondamento + -- se foro sopra o sotto e inclinato if dMaxDepth > 0 and abs( vtExtr:getZ()) > abs( vtExtr:getY()) then - local CosB = abs( vtExtr:getY()) + local CosB = abs( vtExtr:getZ()) if bInMid then CosB = sqrt( vtExtr:getY() * vtExtr:getY() + vtExtr:getX() * vtExtr:getX()) end