From 376f85d1f93ed61f6fbceb81d7011b9febfc37fb Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Fri, 31 Mar 2023 14:59:46 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20In=20LapJoint=20correzione=20al=20calcol?= =?UTF-8?q?o=20della=20distanza=20di=20collisione=20nel=20caso=20in=20cui?= =?UTF-8?q?=20il=20gambo=20sia=20pi=C3=B9=20piccolo=20dell'utensile.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/ProcessLapJoint.lua | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index cdd8172..d8b8b4c 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -64,6 +64,7 @@ -- 2023/02/06 Alla MakeDrillOnCorner aggiunto controllo distanza di sicurezza minima. -- 2023/02/16 Piccola correzione alla scelta utensile di svuotatura. -- 2023/02/21 Piccola correzione alla MakeByPocket. +-- 2023/03/31 Correzione al calcolo della distanza di collisione nel caso in cui il gambo sia più piccolo dell'utensile. -- Tabella per definizione modulo local ProcessLapJoint = {} @@ -5390,8 +5391,34 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa -- eseguo la svuotatura della faccia principale, mi restituisce id utensile, il diametro utensile per il foro opzionale local tvtNx = {} tvtNx[2] = vtN + -- recupero alcuni parametri dell'utensile per decidere la distanza di sicurezza da utilizzare + local dMaxToolCutDepth = 0 + local dMaxToolMaterial = 0 + local dToolThLength = 999 + local dToolTotalLength = 0 + local dToolThDiameter = 999 + local dToolDiameter = 0 + if EgtMdbSetCurrMachining( sPocketing) then + local sTuuidPk = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) + if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuidPk) or '') then + dMaxToolCutDepth = EgtTdbGetCurrToolMaxDepth() or dMaxToolCutDepth + dMaxToolMaterial = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxToolMaterial + dToolDiameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiameter + dToolThLength = EgtTdbGetCurrToolThLength() or dToolThLength + dToolThDiameter = EgtTdbGetCurrToolParam( MCH_TP.STEMDIAM) or dToolThDiameter + dToolTotalLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) or dToolTotalLength + end + end + local dMachiningDepth = 0 + -- se il gambo è più largo dell'utensile verifico se la lunghezza del gambo è maggiore della distanza di sicurezza calcolata + local dShankLength = dToolTotalLength - dToolThLength - dMaxToolCutDepth + if ( dMaxToolCutDepth < dMaxToolMaterial + 10 * GEO.EPS_SMALL) and ( dShankLength > dCollSic + 10 * GEO.EPS_SMALL) then + dMachiningDepth = dFacElev + BD.COLL_SIC + else + dMachiningDepth = dFacElev + dCollSic + end local bOk, sWarn2 - bOk, sWarn2, sTuuidPk, dDiamTool = MakePocket( Proc, nPartId, b3Solid, ptC, tvtNx, nFacInd, sMchFind, nUseRoughTool, sPocketing, dFacElev + dCollSic, nil, nil, bAllWithEndCap) + bOk, sWarn2, sTuuidPk, dDiamTool = MakePocket( Proc, nPartId, b3Solid, ptC, tvtNx, nFacInd, sMchFind, nUseRoughTool, sPocketing, dMachiningDepth, nil, nil, bAllWithEndCap) if not bOk then return false, sWarn2 end if sWarn2 then if not sWarn then sWarn = '' end