- modifiche per aggiunta strategia BladePlusChain

- in BeamExec versione  primordiale di FindBlade
This commit is contained in:
luca.mazzoleni
2024-05-17 18:45:36 +02:00
parent 5dcc75587d
commit 7165db47f6
8 changed files with 948 additions and 52 deletions
+56 -4
View File
@@ -53,6 +53,19 @@ local function GetToolEntryAngle( Proc, vtTool)
end
-------------------------------------------------------------------------------------------------------------
function MachiningLib.GetMachiningSteps( dMachiningDepth, dStep)
local MachiningSteps = {}
MachiningSteps.StepLength = 0
MachiningSteps.Count = ceil( ( dMachiningDepth - 10 * GEO.EPS_SMALL) / dStep)
if MachiningSteps.Count > 1 then
MachiningSteps.StepLength = ( dMachiningDepth - dStep) / ( MachiningSteps.Count - 1)
end
return MachiningSteps
end
-------------------------------------------------------------------------------------------------------------
-- funzione per cercare utensile tipo FRESA con certe caratteristiche
function MachiningLib.FindMill( Proc, sMillType, sMillShape, dMaxToolDiameter, dElevation, vtToolDir)
@@ -81,8 +94,7 @@ function MachiningLib.FindMill( Proc, sMillType, sMillShape, dMaxToolDiameter, d
-- calcolo riduzione del massimo materiale utilizzabile
local dToolEntryAngle = GetToolEntryAngle( Proc, vtToolDir)
-- se ToolHolder più grande dell'utensile, il primo oggetto in collisione è il ToolHolder. Altrimenti il motore.
-- TODO Per il momento il motore ha un valore fisso: diametro di 180. Vedere se scrivere il diametro corretto in BeamData
local dDimObjToCheck = EgtIf( TOOLS[nCurrIndex].ToolHolder.dDiameter > TOOLS[nCurrIndex].dDiameter, TOOLS[nCurrIndex].ToolHolder.dDiameter, 180)
local dDimObjToCheck = EgtIf( TOOLS[nCurrIndex].ToolHolder.dDiameter > TOOLS[nCurrIndex].dDiameter, TOOLS[nCurrIndex].ToolHolder.dDiameter, BeamData.C_SIMM_ENC)
local dCurrMaxMatReduction = BeamData.COLL_SIC or 5
-- calcolo riduzione per non toccare con ToolHolder / Motore
@@ -117,13 +129,53 @@ function MachiningLib.FindMill( Proc, sMillType, sMillShape, dMaxToolDiameter, d
end
end
return ToolInfo
end
-------------------------------------------------------------------------------------------------------------
-- funzione per cercare utensile tipo LAMA con certe caratteristiche
-- TODO da fare
function MachiningLib.FindBlade()
-- TODO da completare
function MachiningLib.FindBlade( Proc, ToolSearchParameters)
local Tool = {}
-- parametri obbligatori
if type( ToolSearchParameters.vtToolDirection) ~= 'table' then
error( 'FindBlade : missing tool direction')
end
if type( ToolSearchParameters.bAllowTopHead) ~= 'boolean' then
error( 'FindBlade : missing top head info')
end
if type( ToolSearchParameters.bAllowBottomHead) ~= 'boolean' then
error( 'FindBlade : missing bottom head info')
end
if not ToolSearchParameters.bAllowTopHead and not ToolSearchParameters.bAllowBottomHead then
error( 'FindBlade : wrong head info')
end
-- parametri opzionali
ToolSearchParameters.dElevation = ToolSearchParameters.dElevation or 0
ToolSearchParameters.bForceLongcutBlade = ToolSearchParameters.bForceLongcutBlade or false
local nChosenToolIndex
for i = 1, #TOOLS do
local bIsToolCompatible = true
if ToolSearchParameters.bAllowTopHead and not ToolSearchParameters.bAllowBottomHead then
bIsToolCompatible = TOOLS[i].bIsTopHead
elseif ToolSearchParameters.bAllowBottomHead and not ToolSearchParameters.bAllowTopHead then
bIsToolCompatible = TOOLS[i].bIsBottomHead
end
if bIsToolCompatible then
nChosenToolIndex = i
break
end
end
Tool = TOOLS[nChosenToolIndex]
return Tool
end
-------------------------------------------------------------------------------------------------------------