From 0528ac4a315ebd1202ba21ba8d9abdc5b892271b Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Fri, 26 Aug 2022 18:30:49 +0200 Subject: [PATCH] BugFix/DoubleCutCollision: doublecut impostata per lanciare fresatura di lato in caso di lavorazione con lama problematica; da aggiungere la fresatura di lato --- LuaLibs/ProcessDoubleCut.lua | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/LuaLibs/ProcessDoubleCut.lua b/LuaLibs/ProcessDoubleCut.lua index 2b8dce9..1853d1b 100644 --- a/LuaLibs/ProcessDoubleCut.lua +++ b/LuaLibs/ProcessDoubleCut.lua @@ -273,6 +273,33 @@ function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) -- eseguo local sCutType = EgtIf( bHead, 'HeadSide', 'TailSide') local bDownHead = ( BD.DOWN_HEAD and vtNm:getZ() < BD.NZ_MINB) + + if BD.C_SIMM and not bDownHead then + local sCutting = ML.FindCutting( sCutType, nil, bDownHead) + if not sCutting then + local sErr = 'Error : cutting not found in library' + EgtOutLog( sErr) + return false, sErr + end + local dMaxDepth = 0 + if EgtMdbSetCurrMachining( sCutting) then + local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) + if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then + dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth + end + end + local _, _, dDimV1 = BL.GetFaceHvRefDim( Proc.Id, 0, b3Raw) + local _, _, dDimV2 = BL.GetFaceHvRefDim( Proc.Id, 1, b3Raw) + local bFace1TooLongForBlade, bFace2TooLongForBlade = ( dDimV1 >= dMaxDepth), ( dDimV2 >= dMaxDepth) + local dFace1Ang, dFace2Ang = vtN[1]:getZ(), vtN[2]:getZ() + if bFace1TooLongForBlade and dFace1Ang < -0.485 or bFace2TooLongForBlade and dFace2Ang < -0.485 then + -- local bOk, sErr = LapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) + -- if not bOk then + -- return bOk, sErr + -- end + end + end + local bOk, sErr = Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType, false, bDownHead) if not bOk then return bOk, sErr end -- segnalazione ingombro di testa o coda