From 04f40edd1625fe4d8b8868c0f523888dff692d0e Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Fri, 31 May 2024 11:52:19 +0200 Subject: [PATCH 1/2] In MachiningLib.FindMill si controlla direzione utensile e se fresa lavora di testa --- LuaLibs/MachiningLib.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/LuaLibs/MachiningLib.lua b/LuaLibs/MachiningLib.lua index 849765b..06dc9e3 100644 --- a/LuaLibs/MachiningLib.lua +++ b/LuaLibs/MachiningLib.lua @@ -87,6 +87,12 @@ function MachiningLib.FindMill( Proc, ToolSearchParameters) bIsToolCompatible = false elseif TOOLS[i].dDiameter > ToolSearchParameters.dMaxToolDiameter then bIsToolCompatible = false + elseif TOOLS[i].SetupInfo.bIsTopHead and ToolSearchParameters.vtToolDirection:getZ() < TOOLS[i].SetupInfo.dMaxNegativeAngle then + bIsToolCompatible = false + elseif TOOLS[i].SetupInfo.bIsBottomHead and ToolSearchParameters.vtToolDirection:getZ() > TOOLS[i].SetupInfo.dMaxPositiveAngle then + bIsToolCompatible = false + elseif TOOLS[i].sType == 'MILL_NOTIP' and ToolSearchParameters.sType == 'MILL_STD' then + bIsToolCompatible = false elseif ToolSearchParameters.sMillShape == 'STANDARD' and ( TOOLS[i].dSideAngle ~= 0 or TOOLS[i].bIsPen) then bIsToolCompatible = false elseif ToolSearchParameters.sMillShape == 'DOVETAIL' and not TOOLS[i].bIsDoveTail then @@ -101,7 +107,7 @@ function MachiningLib.FindMill( Proc, ToolSearchParameters) -- scelgo il migliore if bIsToolCompatible then -- calcolo riduzione del massimo materiale utilizzabile - local ToolEntryAngle = GetToolEntryAngle( Proc, ToolSearchParameters.vtToolDir) + local ToolEntryAngle = GetToolEntryAngle( Proc, ToolSearchParameters.vtToolDirection) -- se ToolHolder più grande dell'utensile, il primo oggetto in collisione è il ToolHolder. Altrimenti il motore. local dDimObjToCheck = EgtIf( TOOLS[i].ToolHolder.dDiameter > TOOLS[i].dDiameter, TOOLS[i].ToolHolder.dDiameter, BeamData.C_SIMM_ENC) local dCurrentMaxMatReduction = BeamData.COLL_SIC or 5 @@ -130,7 +136,7 @@ function MachiningLib.FindMill( Proc, ToolSearchParameters) dBestToolResidualDepth = dCurrentResidualDepth -- se hanno stesso montaggio elseif TOOLS[i].SetupInfo.bToolOnAggregate == TOOLS[nBestToolIndex].SetupInfo.bToolOnAggregate then - -- scelgo utensile con rapporto lunghezza / diametro minore + -- scelgo utensile con indice di bontà utensile calcolato come: lunghezza / massimo materiale / diametro if ( TOOLS[i].dLength / TOOLS[i].dMaxMaterial) / TOOLS[i].dDiameter < ( TOOLS[nBestToolIndex].dLength / TOOLS[nBestToolIndex].dMaxMaterial) / TOOLS[nBestToolIndex].dDiameter then nBestToolIndex = i dBestToolResidualDepth = dCurrentResidualDepth From 26c6cc68c99a010d6a3c5fdbf98eb65f7c8405b2 Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Fri, 31 May 2024 12:54:50 +0200 Subject: [PATCH 2/2] =?UTF-8?q?In=20MachiningLib.FindMill=20se=20si=20cerc?= =?UTF-8?q?a=20una=20fresa=20che=20non=20pu=C3=B2=20lavorare=20di=20testa,?= =?UTF-8?q?=20quelle=20che=20lavorano=20di=20testa=20sono=20comunque=20amm?= =?UTF-8?q?esse?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/MachiningLib.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/LuaLibs/MachiningLib.lua b/LuaLibs/MachiningLib.lua index 06dc9e3..ed98c02 100644 --- a/LuaLibs/MachiningLib.lua +++ b/LuaLibs/MachiningLib.lua @@ -84,15 +84,18 @@ function MachiningLib.FindMill( Proc, ToolSearchParameters) -- prima verifico che utensile sia compatibile local bIsToolCompatible = true if TOOLS[i].sType ~= ToolSearchParameters.sType then - bIsToolCompatible = false + -- se sto cercando una fresa che non può lavorare di testa, quelle che lavorano di testa sono comunque ammesse + if TOOLS[i].sType == 'MILL_STD' and ToolSearchParameters.sType == 'MILL_NOTIP' then + bIsToolCompatible = true + else + bIsToolCompatible = false + end elseif TOOLS[i].dDiameter > ToolSearchParameters.dMaxToolDiameter then bIsToolCompatible = false elseif TOOLS[i].SetupInfo.bIsTopHead and ToolSearchParameters.vtToolDirection:getZ() < TOOLS[i].SetupInfo.dMaxNegativeAngle then bIsToolCompatible = false elseif TOOLS[i].SetupInfo.bIsBottomHead and ToolSearchParameters.vtToolDirection:getZ() > TOOLS[i].SetupInfo.dMaxPositiveAngle then bIsToolCompatible = false - elseif TOOLS[i].sType == 'MILL_NOTIP' and ToolSearchParameters.sType == 'MILL_STD' then - bIsToolCompatible = false elseif ToolSearchParameters.sMillShape == 'STANDARD' and ( TOOLS[i].dSideAngle ~= 0 or TOOLS[i].bIsPen) then bIsToolCompatible = false elseif ToolSearchParameters.sMillShape == 'DOVETAIL' and not TOOLS[i].bIsDoveTail then