From ec14595f60934f590bd252b141562c8b8c35a727 Mon Sep 17 00:00:00 2001 From: DarioS Date: Fri, 26 Nov 2021 09:21:45 +0100 Subject: [PATCH] =?UTF-8?q?DataBeam=20:=20-=20migliorata=20riconoscimento?= =?UTF-8?q?=20necessit=C3=A0=20rotazione=20per=20taglio=20doppio=20convess?= =?UTF-8?q?o=20-=20modifiche=20per=20tagli=20lunghi=20con=20lama.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/ProcessCut.lua | 2 +- LuaLibs/ProcessDoubleCut.lua | 17 ++++++++++++++--- LuaLibs/ProcessLongCut.lua | 8 ++++++-- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/LuaLibs/ProcessCut.lua b/LuaLibs/ProcessCut.lua index 89ce155..06e25c4 100644 --- a/LuaLibs/ProcessCut.lua +++ b/LuaLibs/ProcessCut.lua @@ -240,7 +240,7 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b -- verifico se da considerare taglio lungo ( non da sotto, inclinato meno di 21.56deg, largo come la trave e abbastanza lungo) local bLongCut = ( not bDownCut and vtN:getZ() > 0.93 and Proc.Box:getDimY() > b3Solid:getDimY() - 10 * GEO.EPS_SMALL and - ( Proc.Box:getDimX() > 0.75 * b3Solid:getDimX() or Proc.Box:getDimX() > 1500.000)) + ( Proc.Box:getDimX() > 0.75 * b3Solid:getDimX() or Proc.Box:getDimX() > 600.000)) -- se taglio lungo e Q04 = 1 allora lancio il processo dell'L10 if bLongCut and EgtGetInfo( Proc.Id, 'Q04', 'i') == 1 then return LongCut.Make( Proc, nPhase, nRawId, nPartId, true) diff --git a/LuaLibs/ProcessDoubleCut.lua b/LuaLibs/ProcessDoubleCut.lua index 95c6f7a..87acb9d 100644 --- a/LuaLibs/ProcessDoubleCut.lua +++ b/LuaLibs/ProcessDoubleCut.lua @@ -1,4 +1,4 @@ --- ProcessDoubleCut.lua by Egaltech s.r.l. 2021/11/05 +-- ProcessDoubleCut.lua by Egaltech s.r.l. 2021/11/25 -- Gestione calcolo doppi tagli di lama per Travi -- Tabella per definizione modulo @@ -32,6 +32,8 @@ function ProcessDoubleCut.Classify( Proc, b3Raw) if BD.C_SIMM and BD.DOWN_HEAD then return true end + -- limite per facce da sotto + local dNzLimDwnUp = BL.GetNzLimDownUp( b3Raw) -- verifico se convesso local bAdj, _, _, dAng = EgtSurfTmFacetsContact( Proc.Id, 0, 1, GDB_ID.ROOT) local bConvex = ( not bAdj or ( dAng > 0)) @@ -46,10 +48,19 @@ function ProcessDoubleCut.Classify( Proc, b3Raw) return true, true end end + local bDownCut = ( vtN:getZ() <= dNzLimDwnUp) + if bDownCut then + local _, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, nFac) + -- confronto anche qua la distanza maggiore della faccia con la massima distanza del DiceCut + -- e se il rapporto supera il 2 (implica che genera 3 tagli) dichiaro impossibile la lavorazione + if DimH and BD.MAX_DIM_DICE and abs( BD.MAX_DIM_DICE) > 20 * GEO.EPS_SMALL and abs( DimH / BD.MAX_DIM_DICE) > 2 then + return true, true + end + end end + return true, false end - -- verifico le normali delle facce per tagli da sotto - local dNzLimDwnUp = BL.GetNzLimDownUp( b3Raw) + -- altrimenti concavo, verifico le normali delle facce per tagli da sotto for i = 1, 2 do local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, i-1, GDB_ID.ROOT) local bDownCut = ( vtN:getZ() <= dNzLimDwnUp) diff --git a/LuaLibs/ProcessLongCut.lua b/LuaLibs/ProcessLongCut.lua index 0e3f49e..f7dc92c 100644 --- a/LuaLibs/ProcessLongCut.lua +++ b/LuaLibs/ProcessLongCut.lua @@ -457,7 +457,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus end -- Se non limitato o forzato uso lama e da sopra e richiesto con doppio taglio di lama e superiore al limite minimo - if ( ( not bLimXmin and not bLimXmax) or bForceUseBladeOnNotThruFace) and ( bCanUseUnderBlade or bCanUseBlade) and nUseBlade > 0 and Proc.Box:getDimX() > dLimMinPiece - 1 then + if ( ( not bLimXmin and not bLimXmax) or bForceUseBladeOnNotThruFace) and ( bCanUseUnderBlade or bCanUseBlade) and nUseBlade > 0 and b3Solid:getDimX() > dLimMinPiece - 1 then local sCutting local dToolDiam = 0 local dThick = 0 @@ -867,7 +867,11 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus -- se il flag uso lama custom abilitato (indica che questo script è lanciato dal ProcessCut) -- controllo se componente X versore è maggiore di un valore limite cambio la direzione della forcella if bCustUseBlade and abs(vtN:getX()) > 0.009 + 5 * GEO.EPS_SMALL then - nSCC = EgtIf( ( not bFront and k == 1) or ( bFront and k == 2), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM) + if BD.USE_LONGCUT then + nSCC = EgtIf( ( bFront and k == 1) or ( not bFront and k == 2), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM) + else + nSCC = EgtIf( ( not bFront and k == 1) or ( bFront and k == 2), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM) + end end -- imposto posizione braccio porta testa per non ingombrare agli estremi EgtSetMachiningParam( MCH_MP.SCC, nSCC)