diff --git a/LuaLibs/ProcessCut.lua b/LuaLibs/ProcessCut.lua index b906794..969dd2b 100644 --- a/LuaLibs/ProcessCut.lua +++ b/LuaLibs/ProcessCut.lua @@ -1,4 +1,4 @@ --- ProcessCut.lua by Egaltech s.r.l. 2019/11/12 +-- ProcessCut.lua by Egaltech s.r.l. 2019/11/26 -- Gestione calcolo singoli tagli di lama per Travi -- Tabella per definizione modulo @@ -36,7 +36,7 @@ end --------------------------------------------------------------------- -- Applicazione della lavorazione -function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) +function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom) -- ingombro del grezzo local b3Raw = EgtGetRawPartBBox( nRawId) -- ingombro del pezzo @@ -163,8 +163,14 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) else -- lavoro la faccia local vtOrthoO - if bHorizCut then + if bFromBottom and vtN:getZ() > 0 then + vtOrthoO = -Z_AX() + elseif bHorizCut then vtOrthoO = Z_AX() + elseif abs( vtN:getY()) > 0.02 and Proc.Head then + vtOrthoO = X_AX() + elseif abs( vtN:getY()) > 0.02 and Proc.Tail then + vtOrthoO = -X_AX() elseif vtN:getY() > -0.02 then vtOrthoO = Y_AX() else diff --git a/LuaLibs/ProcessTenon.lua b/LuaLibs/ProcessTenon.lua index f0adac2..e02f4da 100644 --- a/LuaLibs/ProcessTenon.lua +++ b/LuaLibs/ProcessTenon.lua @@ -1,4 +1,4 @@ --- ProcessTenon.lua by Egaltech s.r.l. 2019/09/27 +-- ProcessTenon.lua by Egaltech s.r.l. 2019/11/26 -- Gestione calcolo tenone per Travi -- Tabella per definizione modulo @@ -137,8 +137,9 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) EgtRelocate( AddId, nAddGrpId) EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id)) -- applico lavorazione - local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg} - local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, 0) + local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, Head = Proc.Head, Tail = Proc.Tail} + local bFromBottom = ( b3Solid:getDimX() < 1000 and vtExtr:getZ() > 0.25) + local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, 0, bFromBottom) if not bOk then return bOk, sErr end end end