From d1309ccd2373e9191526871e1c87ab9e98c11a19 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Tue, 15 Sep 2020 09:24:14 +0000 Subject: [PATCH] DataBeam : - in DoubleCut convesso ora passo ai tagli singoli il giusto ingombro della faccia da lavorare. --- LuaLibs/ProcessDoubleCut.lua | 42 ++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/LuaLibs/ProcessDoubleCut.lua b/LuaLibs/ProcessDoubleCut.lua index f1427cd..5f0369a 100644 --- a/LuaLibs/ProcessDoubleCut.lua +++ b/LuaLibs/ProcessDoubleCut.lua @@ -1,4 +1,4 @@ --- ProcessDoubleCut.lua by Egaltech s.r.l. 2020/08/18 +-- ProcessDoubleCut.lua by Egaltech s.r.l. 2020/09/15 -- Gestione calcolo doppi tagli di lama per Travi -- Tabella per definizione modulo @@ -207,8 +207,9 @@ function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) if AddId then EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id)) EgtSetInfo( AddId, 'TASKID', Proc.TaskId) + local b3Fac = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vOrd[1] - 1, GDB_BB.STANDARD) -- applico lavorazione - local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, + local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Fac, Fct = Proc.Fct, Flg = Proc.Flg, Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, 0) if not bOk then return bOk, sErr end @@ -218,8 +219,9 @@ function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) if AddId then EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id)) EgtSetInfo( AddId, 'TASKID', Proc.TaskId) + local b3Fac = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vOrd[2] - 1, GDB_BB.STANDARD) -- applico lavorazione - local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, + local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Fac, Fct = Proc.Fct, Flg = Proc.Flg, Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, 0) if not bOk then return bOk, sErr end @@ -261,23 +263,25 @@ function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) end end end - -- eventuale segnalazione ingombro di testa o coda - if Proc.Head then - local dOffs = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX() - if vtNm:getZ() > 0.5 then - dOffs = 0.4 * dOffs - elseif abs( vtNm:getZ()) > 0.35 then - dOffs = 0.75 * dOffs + -- eventuale segnalazione ingombro di testa o coda (se non convesso, altrimenti giĆ  fatto nei tagli singoli) + if not bConvex then + if Proc.Head then + local dOffs = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX() + if vtNm:getZ() > 0.5 then + dOffs = 0.4 * dOffs + elseif abs( vtNm:getZ()) > 0.35 then + dOffs = 0.75 * dOffs + end + BL.UpdateHCING( nRawId, dOffs) + elseif Proc.Tail then + local dOffs = Proc.Box:getMax():getX() - b3Solid:getMin():getX() + if vtNm:getZ() > 0.5 then + dOffs = 0.4 * dOffs + elseif abs( vtNm:getZ()) > 0.35 then + dOffs = 0.75 * dOffs + end + BL.UpdateTCING( nRawId, dOffs) end - BL.UpdateHCING( nRawId, dOffs) - elseif Proc.Tail then - local dOffs = Proc.Box:getMax():getX() - b3Solid:getMin():getX() - if vtNm:getZ() > 0.5 then - dOffs = 0.4 * dOffs - elseif abs( vtNm:getZ()) > 0.35 then - dOffs = 0.75 * dOffs - end - BL.UpdateTCING( nRawId, dOffs) end return true end