From 4c41ecc7cb422dafe9958053e8506fc4a89bd4d5 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Thu, 9 Mar 2023 17:40:24 +0100 Subject: [PATCH] 2.5c4: - in LapJoint aggiunta lavorazione fessure poco inclinate con lama --- LuaLibs/WMachiningLib.lua | 6 ++++-- LuaLibs/WProcessLapJoint.lua | 25 ++++++++++++++++--------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/LuaLibs/WMachiningLib.lua b/LuaLibs/WMachiningLib.lua index edab88d..cb1fd70 100644 --- a/LuaLibs/WMachiningLib.lua +++ b/LuaLibs/WMachiningLib.lua @@ -3,6 +3,7 @@ -- Tabella per definizione modulo -- 2023/03/09 Piccola correzione alla SideDepth in FindMilling +-- In FindMilling aggiunta gestione spessore e massimo materiale nel caso di lam local WMachiningLib = {} -- Include @@ -56,14 +57,15 @@ function WMachiningLib.FindMilling( sType, dDepth, sTuuid, nTool_ID, dMaxDiam, d for i = 1, #Millings do local Milling = Millings[i] if Milling.On and Milling.Type == sType and SetCurrMachiningAndTool( Milling.Name) then + local bIsBlade = ( EgtTdbGetCurrToolParam( MCH_TP.TYPE) & MCH_TF.SAWBLADE ~= 0) or false local nMchType = EgtMdbGetCurrMachiningParam( MCH_MP.TYPE) local sMyTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) - local dTMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) + local dTMaxMat = EgtIf( bIsBlade, EgtTdbGetCurrToolParam( MCH_TP.THICK), EgtTdbGetCurrToolParam( MCH_TP.MAXMAT)) local dTMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, dTMaxMat, EgtTdbGetCurrToolMaxDepth()) local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) local dTDiamTh = EgtTdbGetCurrToolThDiam() or 0 local dTTipFeed = EgtTdbGetCurrToolParam( MCH_TP.TIPFEED) - local dTMaxDepthOnSide = min( EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDEDEPTH', 'd') or 999, 0.5 * ( dTDiam - dTDiamTh)) + local dTMaxDepthOnSide = EgtIf( bIsBlade, EgtTdbGetCurrToolParam( MCH_TP.MAXMAT), min( EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDEDEPTH', 'd') or 999, 0.5 * ( dTDiam - dTDiamTh))) local nMyTool_ID = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'Tool_ID', 'i') if nMchType == MCH_MY.MILLING and ( not sTuuid or sTuuid == sMyTuuid) and diff --git a/LuaLibs/WProcessLapJoint.lua b/LuaLibs/WProcessLapJoint.lua index 1209352..dc0fa58 100644 --- a/LuaLibs/WProcessLapJoint.lua +++ b/LuaLibs/WProcessLapJoint.lua @@ -15,6 +15,7 @@ -- 2022/12/01 Per 2 facce con angolo > 90° implementata lavorazione principale verticale. Se da sopra, aggiunta ripresa del lato inclinato. -- 2022/12/14 Nel caso di 2 facce piccola correzione al modo di ordinare le facce. -- 2023/03/09 Gestito caso riconoscimento errato Stype 3 +-- 2023/03/09 In MakeMoreFaces aggiunta la possibilità di lavorare le fessure con la lama -- Tabella per definizione modulo local WPL = {} @@ -2546,15 +2547,17 @@ local function MakeMoreFaces( Proc, nRawId, b3Raw) end local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT) local _, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT) + local dMaxSlotThicknessForBlade = 25 + local bTryWithBlade = Proc.Fct == 3 and ( min( dH, dV) < dMaxSlotThicknessForBlade + 10 * GEO.EPS_SMALL) and vtN:getZ() > -0.01 -- se di fianco - if not bPckt and Proc.Fct >= 3 and vtN:getZ() < WD.NZ_MINA then + if not bPckt and Proc.Fct >= 3 and ( ( vtN:getZ() < WD.NZ_MINA) or bTryWithBlade) then -- recupero elevazione faccia in feature local dSideElev = WL.GetFaceElevation( Proc.Id, nFacInd) -- se abilitata lavorazione ribasso con fresa di fianco e parametro Q03 abilitato local sMillOnSide, dTMaxDepth, dMaxMat, dDiam = WM.FindMilling( 'SideMill', nil, nil, nil, nil, min( dH, dV), nil, dSideElev) local _, nUseMillOnSide = EvaluateQParam( Proc) -- se ho abilitata lavorazione di fresa di fianco - if Proc.Fct >= 3 and sMillOnSide and nUseMillOnSide >= 1 then + if Proc.Fct >= 3 and sMillOnSide and nUseMillOnSide >= 1 and not bTryWithBlade then -- cerco nei parametri utensili la nota di affondamento di fianco SIDEDEPTH local dMaxDepthOnSide = 0 local dMillDiam = 0 @@ -2596,15 +2599,17 @@ local function MakeMoreFaces( Proc, nRawId, b3Raw) end else -- fresatura (se definita) - local sMilling = WM.FindMilling( 'SideGroove') + local sMilling = WM.FindMilling( 'SideGroove', nil, nil, nil, nil, min( dH, dV)) -- recupero i dati dell'utensile local dMaxMat = 1000 local dMaxDepthOnSide = 0 + local bIsBlade = false if sMilling and EgtMdbSetCurrMachining( sMilling) then local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then local dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam - if ( EgtTdbGetCurrToolParam( MCH_TP.TYPE) & MCH_TF.SAWBLADE) ~= 0 then + bIsBlade = EgtTdbGetCurrToolParam( MCH_TP.TYPE) & MCH_TF.SAWBLADE ~= 0 + if bIsBlade then dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dMaxMat dMaxDepthOnSide = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) else @@ -2617,11 +2622,13 @@ local function MakeMoreFaces( Proc, nRawId, b3Raw) end end end - if sMilling and dElev < dMaxDepthOnSide and dMaxMat <= min( dH, dV) + 20 * GEO.EPS_SMALL then - return MakeSideGrooveByMill( Proc, nFacInd, nRawId, b3Raw, sMilling) - -- altrimenti sega a catena - else - return MakeByChainSaw( Proc, nFacInd, nRawId, b3Raw, dElev, dH, dV) + if ( not bTryWithBlade) or bIsBlade then + if sMilling and dElev < dMaxDepthOnSide then + return MakeSideGrooveByMill( Proc, nFacInd, nRawId, b3Raw, sMilling) + -- altrimenti sega a catena + else + return MakeByChainSaw( Proc, nFacInd, nRawId, b3Raw, dElev, dH, dV) + end end end end