diff --git a/LuaLibs/MachiningLib.lua b/LuaLibs/MachiningLib.lua index acdfac0..9e86b23 100644 --- a/LuaLibs/MachiningLib.lua +++ b/LuaLibs/MachiningLib.lua @@ -575,7 +575,7 @@ function MachiningLib.FindBlade( Proc, ToolSearchParameters) local bAllowBottomHead = ToolSearchParameters.bAllowBottomHead -- parametri opzionali - local dElevation = ToolSearchParameters.dElevation or 0 + local dElevation = ToolSearchParameters.dElevation local bForceLongcutBlade = ToolSearchParameters.bForceLongcutBlade or false local EdgeToMachine = ToolSearchParameters.EdgeToMachine local Part = ToolSearchParameters.Part @@ -636,7 +636,7 @@ function MachiningLib.FindBlade( Proc, ToolSearchParameters) if bIsToolCompatible then -- TODO gestire accorciamento massimo materiale per inclinazione - local dCurrentResidualDepth = dElevation - TOOLS[i].dMaxDepth + local dCurrentResidualDepth = ( dElevation or 0) - TOOLS[i].dMaxDepth if not nBestToolIndex or ( dBestToolResidualDepth > 0 and dCurrentResidualDepth <= 10 * GEO.EPS_SMALL) then nBestToolIndex = i dBestToolResidualDepth = dCurrentResidualDepth diff --git a/LuaLibs/PreSimulationLib.lua b/LuaLibs/PreSimulationLib.lua index 5e5aa2e..5d983b6 100644 --- a/LuaLibs/PreSimulationLib.lua +++ b/LuaLibs/PreSimulationLib.lua @@ -238,6 +238,43 @@ local function CheckCollisionWithAxis( sAxis, MachiningParameters, OptionalParam vtC = -vtC end + + + + + + -- TEST + -- for i = 1, #ToolExitPoints do + -- EgtSetCalcTool( Tool.sName, Tool.sHead, 1) + -- EgtLoadTool( Tool.sHead, 1, Tool.sName) + + -- EgtSetCalcSolCh( nSCC) + -- local bOkAngles, nSolutionsAngles, dC1, dA1, dC2, dA2 = EgtGetCalcAngles( vtHead, vtSCC) + -- local bOkPositions, _, dT, dY, dZ = EgtGetCalcPositions( ToolExitPoints[i] - vtHead * ( Tool.dLength - Tool.dThickness), dC1, dA1) -- ATTENZIONE qui il punto รจ sul Tip + + -- EgtSetAxisPos( 'T', dT) + -- EgtSetAxisPos( 'Y', dY) + -- EgtSetAxisPos( 'Z', dZ) + -- EgtSetAxisPos( 'C', dC1) + -- EgtSetAxisPos( 'A', dA1) + + -- local idPoint = EgtPoint( 0, PointsToCheck[i], 0) + -- EgtOutLog( 'Point id ' .. idPoint) + -- EgtOutLog( 'SCC = ' .. tostring(nSCC) .. ', vtHead = ' .. tostring( vtHead) .. ', vtAux = ' .. tostring(vtSCC)) + -- EgtOutLog( 'Solutions found = ' .. tostring( nSolutionsAngles) .. ', T = ' .. dT .. ', Y = ' .. dY .. ', Z = ' .. dZ .. ', C1 = ' .. dC1 .. ', A1 = ' .. dA1 .. ' (C2 = ' .. dC2 .. ', A2 = ' .. dA2 ..')') + -- end + + -- FINE TEST + + + + + + + + + + -- punti curva collisione e direzioni check da macchina local PreCollisionData = Tool.SetupInfo.GetPreCollisionData( sAxis, vtC, vtHead) diff --git a/StrategyLibs/BLADETOWASTE.lua b/StrategyLibs/BLADETOWASTE.lua index 37332ed..a6202ed 100644 --- a/StrategyLibs/BLADETOWASTE.lua +++ b/StrategyLibs/BLADETOWASTE.lua @@ -422,6 +422,7 @@ local function GetSingleCutStrategy( Proc, Part, OptionalParameters) local ToolInfo = MachiningLib.FindBlade( Proc, { bAllowTopHead = true, bAllowBottomHead = false, + dElevation = EdgeToMachineList.TopGuillotine.dElevation, FaceToMachine = FaceToMachine, EdgeToMachine = EdgeToMachineList.TopGuillotine, Part = Part