From aafe565474d59f47c6dfc1ce5238efb2517d8fd1 Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Thu, 10 Oct 2024 12:40:27 +0200 Subject: [PATCH 1/2] In ScarfJoint corretto problema introdotto con modifica ottimizzazione richiesta per Ticket#1992 --- LuaLibs/ProcessScarfJoint.lua | 41 +++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/LuaLibs/ProcessScarfJoint.lua b/LuaLibs/ProcessScarfJoint.lua index 1b33c52..9654d21 100644 --- a/LuaLibs/ProcessScarfJoint.lua +++ b/LuaLibs/ProcessScarfJoint.lua @@ -196,28 +196,47 @@ local function ApplyDiceCut( vFaceOrd, nGoodFace1, nGoodFace4, nAddGrpId, b3Soli end end - local dDiceFaceMaxH = 0 - local dDiceFaceMinH = GEO.INFINITO + -- controllo per eseguire solo un taglio ottimizzato + local bExecJustOneCut = false + local dDiceFaceDim = GEO.INFINITO if ( i % 2) == 0 then for cont = 1, #vCuts[i] do local _, dDiceFaceH, dDiceFaceV = BL.GetFaceHvRefDim( vCuts[i][cont], 0) - dDiceFaceMaxH = max( dDiceFaceMaxH, dDiceFaceH) - -- calcolo lato orizzontale minore ipotizzando sia un trapezio - local dDiceFaceH2 = ( 2 * EgtSurfArea( vCuts[i][cont]) ) / dDiceFaceV - dDiceFaceH - dDiceFaceMinH = min( dDiceFaceMinH, dDiceFaceH2) + -- se feature verso Z, si ammette anche lavorazione in doppio + if AreSameVectorApprox( vtRef, Z_AX()) then + if dMaxDepth * 2 > dDiceFaceH + BD.CUT_EXTRA then + bExecJustOneCut = true + dDiceFaceDim = dDiceFaceH + break + end + elseif AreSameVectorApprox( vtRef, Y_AX()) or AreSameVectorApprox( vtRef, -Y_AX()) then + if dMaxDepth > dDiceFaceV + BD.CUT_EXTRA then + bExecJustOneCut = true + dDiceFaceDim = dDiceFaceV + break + end + end end end -- se si può fare, faccio unico taglio parallelo - if ( i % 2) == 0 and ( dMaxDepth > dDiceFaceMaxH - 0.5 * dDiceFaceMinH + BD.CUT_EXTRA_MIN) then + if bExecJustOneCut then local bDoubleCut = false local dCutExtra = BD.CUT_EXTRA - if dMaxDepth < dDiceFaceMaxH + BD.CUT_EXTRA then + if dMaxDepth < dDiceFaceDim then bDoubleCut = true - dCutExtra = - 0.5 * dDiceFaceMinH + BD.CUT_EXTRA_MIN end local nSurfToCut = EgtSurfTmBySewing( nAddGrpId, vCuts[i], false) - local nFaceUseCut1, nFaceUseCut2 = MCH_MILL_FU.ORTHO_BACK, MCH_MILL_FU.ORTHO_FRONT - if Proc.Tail then + + local nFaceUseCut1, nFaceUseCut2 + -- se feature rivolta verso alto setto direzione taglio davanti e dietro + if AreSameVectorApprox( vtRef, Z_AX()) then + nFaceUseCut1, nFaceUseCut2 = MCH_MILL_FU.ORTHO_BACK, MCH_MILL_FU.ORTHO_FRONT + -- altrimenti taglio da sopra + else + nFaceUseCut2 = MCH_MILL_FU.ORTHO_DOWN + end + + if Proc.Tail and AreSameVectorApprox( vtRef, Z_AX()) then nFaceUseCut1, nFaceUseCut2 = nFaceUseCut2, nFaceUseCut1 end if bDoubleCut then From 4a21a4be36b1f840d09784857731c3ef956964fc Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Thu, 10 Oct 2024 14:05:52 +0200 Subject: [PATCH 2/2] - in ProcessCut Classify corretta lettura Q per passare a LapJoint --- LuaLibs/ProcessCut.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LuaLibs/ProcessCut.lua b/LuaLibs/ProcessCut.lua index d275a64..6783093 100644 --- a/LuaLibs/ProcessCut.lua +++ b/LuaLibs/ProcessCut.lua @@ -47,7 +47,7 @@ local ML = require( 'MachiningLib') -- Riconoscimento della feature function ProcessCut.Identify( Proc) -- se richiesto si forza fresatura - Proc.bForceMill = ( EgtGetInfo( Proc.Id, 'Q07', 'd') or 0) == 1 + Proc.bForceMill = ( Proc.prc == 30 and ( ( EgtGetInfo( Proc.Id, 'Q07', 'd') or 0) == 1)) if Proc.bForceMill then return false