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