From d2a6d7e75ce0a7aec01e9a7688dd23654b9860a2 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Wed, 6 Dec 2023 10:44:21 +0100 Subject: [PATCH] in ProcessDoubleCut -> Classify si forza la rotazione della trave se inclinata in Y e la lama non riesce a lavorare solo da un lato --- LuaLibs/ProcessDoubleCut.lua | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/LuaLibs/ProcessDoubleCut.lua b/LuaLibs/ProcessDoubleCut.lua index fdf582c..246e356 100644 --- a/LuaLibs/ProcessDoubleCut.lua +++ b/LuaLibs/ProcessDoubleCut.lua @@ -54,10 +54,23 @@ function ProcessDoubleCut.Classify( Proc, b3Raw) local dNzLimDwnUp = BL.GetNzLimDownUp( b3Raw, vtN) local bDownCut = ( vtN:getZ() <= dNzLimDwnUp) if bDownCut then + -- recupero i dati della lama + local sCutType = EgtIf( Proc.Head, 'HeadSide', 'TailSide') + local sCutting = ML.FindCutting( sCutType, true, false) + -- recupero i dati dell'utensile + local dMaxDepth = 0 + local dMaxMat = 0 + if EgtMdbSetCurrMachining( sCutting) then + local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) + if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then + dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth + dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat + end + end -- calcolo l'ingombro orizzontale della faccia - local _, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, nFac) + local _, DimH = BL.GetFaceHvRefDim( Proc.Id, nFac) -- confronto questo ingombro con il doppio della massima dimensione del DiceCut (impossibile lavorare sotto da sopra se più di 2 tagli) - if DimH > 2 * BD.MAX_DIM_DICE then + if DimH > 2 * BD.MAX_DIM_DICE or ( abs( vtN:getY()) > 0.1 and dMaxMat < DimH) then return true, true end end