- 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
+84 -28
View File
@@ -56,17 +56,25 @@ local function GetStrategies_Egalware( Proc)
-- Feature : Slot
elseif ID.IsSlot( Proc) then
if Proc.Topology.sName == 'Pocket-5-Blind' then
Strategies = { { sStrategyId = 'STR0002'}}
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Groove-4-Blind' then
Strategies = { { sStrategyId = 'STR0002'}}
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Groove-3-Through' then
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Tunnel-4-Through' then
Strategies = { { sStrategyId = 'STR0003'}}
end
---------------------------------------------------------------------
-- Feature : Front Slot
elseif ID.IsFrontSlot( Proc) then
if Proc.Topology.sName == 'Pocket-5-Blind' then
Strategies = { { sStrategyId = 'STR0002'}}
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Groove-4-Blind' then
Strategies = { { sStrategyId = 'STR0002'}}
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Groove-3-Through' then
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Tunnel-4-Through' then
Strategies = { { sStrategyId = 'STR0003'}}
end
---------------------------------------------------------------------
-- Feature : Birds Mouth
@@ -78,25 +86,37 @@ local function GetStrategies_Egalware( Proc)
-- Feature : Ridge Lap
elseif ID.IsRidgeLap( Proc) then
if Proc.Topology.sName == 'Pocket-5-Blind' then
Strategies = { { sStrategyId = 'STR0002'}}
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Groove-4-Blind' then
Strategies = { { sStrategyId = 'STR0002'}}
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Groove-3-Through' then
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Tunnel-4-Through' then
Strategies = { { sStrategyId = 'STR0003'}}
end
---------------------------------------------------------------------
-- Feature : Lap Joint
elseif ID.IsLapJoint( Proc) then
if Proc.Topology.sName == 'Pocket-5-Blind' then
Strategies = { { sStrategyId = 'STR0002'}}
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Groove-4-Blind' then
Strategies = { { sStrategyId = 'STR0002'}}
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Groove-3-Through' then
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Tunnel-4-Through' then
Strategies = { { sStrategyId = 'STR0003'}}
end
---------------------------------------------------------------------
-- Feature : Notch/Rabbet
elseif ID.IsNotchRabbet( Proc) then
if Proc.Topology.sName == 'Pocket-5-Blind' then
Strategies = { { sStrategyId = 'STR0002'}}
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Groove-4-Blind' then
Strategies = { { sStrategyId = 'STR0002'}}
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Groove-3-Through' then
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Tunnel-4-Through' then
Strategies = { { sStrategyId = 'STR0003'}}
end
---------------------------------------------------------------------
-- Feature : Block Haus
@@ -105,9 +125,13 @@ local function GetStrategies_Egalware( Proc)
-- Feature : Notch
elseif ID.IsNotch( Proc) then
if Proc.Topology.sName == 'Pocket-5-Blind' then
Strategies = { { sStrategyId = 'STR0002'}}
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Groove-4-Blind' then
Strategies = { { sStrategyId = 'STR0002'}}
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Groove-3-Through' then
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Tunnel-4-Through' then
Strategies = { { sStrategyId = 'STR0003'}}
end
---------------------------------------------------------------------
-- Feature : French Ridge Lap
@@ -125,9 +149,13 @@ local function GetStrategies_Egalware( Proc)
-- Feature : Pocket
elseif ID.IsPocket( Proc) then
if Proc.Topology.sName == 'Pocket-5-Blind' then
Strategies = { { sStrategyId = 'STR0002'}}
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Groove-4-Blind' then
Strategies = { { sStrategyId = 'STR0002'}}
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Groove-3-Through' then
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Tunnel-4-Through' then
Strategies = { { sStrategyId = 'STR0003'}}
end
---------------------------------------------------------------------
-- Feature : Drilling
@@ -268,17 +296,25 @@ local function GetStrategies_Essetre( Proc)
-- Feature : Slot
elseif ID.IsSlot( Proc) then
if Proc.Topology.sName == 'Pocket-5-Blind' then
Strategies = { { sStrategyId = 'STR0002'}}
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Groove-4-Blind' then
Strategies = { { sStrategyId = 'STR0002'}}
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Groove-3-Through' then
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Tunnel-4-Through' then
Strategies = { { sStrategyId = 'STR0003'}}
end
---------------------------------------------------------------------
-- Feature : Front Slot
elseif ID.IsFrontSlot( Proc) then
if Proc.Topology.sName == 'Pocket-5-Blind' then
Strategies = { { sStrategyId = 'STR0002'}}
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Groove-4-Blind' then
Strategies = { { sStrategyId = 'STR0002'}}
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Groove-3-Through' then
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Tunnel-4-Through' then
Strategies = { { sStrategyId = 'STR0003'}}
end
---------------------------------------------------------------------
-- Feature : Birds Mouth
@@ -290,25 +326,37 @@ local function GetStrategies_Essetre( Proc)
-- Feature : Ridge Lap
elseif ID.IsRidgeLap( Proc) then
if Proc.Topology.sName == 'Pocket-5-Blind' then
Strategies = { { sStrategyId = 'STR0002'}}
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Groove-4-Blind' then
Strategies = { { sStrategyId = 'STR0002'}}
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Groove-3-Through' then
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Tunnel-4-Through' then
Strategies = { { sStrategyId = 'STR0003'}}
end
---------------------------------------------------------------------
-- Feature : Lap Joint
elseif ID.IsLapJoint( Proc) then
if Proc.Topology.sName == 'Pocket-5-Blind' then
Strategies = { { sStrategyId = 'STR0002'}}
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Groove-4-Blind' then
Strategies = { { sStrategyId = 'STR0002'}}
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Groove-3-Through' then
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Tunnel-4-Through' then
Strategies = { { sStrategyId = 'STR0003'}}
end
---------------------------------------------------------------------
-- Feature : Notch/Rabbet
elseif ID.IsNotchRabbet( Proc) then
if Proc.Topology.sName == 'Pocket-5-Blind' then
Strategies = { { sStrategyId = 'STR0002'}}
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Groove-4-Blind' then
Strategies = { { sStrategyId = 'STR0002'}}
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Groove-3-Through' then
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Tunnel-4-Through' then
Strategies = { { sStrategyId = 'STR0003'}}
end
---------------------------------------------------------------------
-- Feature : Block Haus
@@ -317,9 +365,13 @@ local function GetStrategies_Essetre( Proc)
-- Feature : Notch
elseif ID.IsNotch( Proc) then
if Proc.Topology.sName == 'Pocket-5-Blind' then
Strategies = { { sStrategyId = 'STR0002'}}
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Groove-4-Blind' then
Strategies = { { sStrategyId = 'STR0002'}}
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Groove-3-Through' then
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Tunnel-4-Through' then
Strategies = { { sStrategyId = 'STR0003'}}
end
---------------------------------------------------------------------
-- Feature : French Ridge Lap
@@ -337,9 +389,13 @@ local function GetStrategies_Essetre( Proc)
-- Feature : Pocket
elseif ID.IsPocket( Proc) then
if Proc.Topology.sName == 'Pocket-5-Blind' then
Strategies = { { sStrategyId = 'STR0002'}}
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Groove-4-Blind' then
Strategies = { { sStrategyId = 'STR0002'}}
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Groove-3-Through' then
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
elseif Proc.Topology.sName == 'Tunnel-4-Through' then
Strategies = { { sStrategyId = 'STR0003'}}
end
---------------------------------------------------------------------
-- Feature : Drilling
+3 -3
View File
@@ -17,7 +17,7 @@ local ID = require( 'Identity')
local BCS = require( 'BasicCustomerStrategies')
local FeatureData = require( 'FeatureData')
local FaceData = require( 'FaceData')
local MachLib = require( 'MachiningLib')
local MachiningLib = require( 'MachiningLib')
EgtOutLog( ' BeamExec started', 1)
@@ -153,8 +153,8 @@ function BeamExec.GetToolsFromDB()
Tool.dDistance = EgtTdbGetCurrToolParam( MCH_TP.DIST) or 90 -- 90mm dimensione standard aggregato catena
Tool.bIsMortise = EgtGetValInNotes( Tool.sUserNotes, 'MORTISE') == 1
Tool.bIsChainSaw = not Tool.bIsMortise
Tool.dStep = EgtGetValInNotes( Tool.sUserNotes, 'STEP') or ( Tool.dThick - 1) -- se non settato nell'utensile, considero spessore catena meno 1mm di sicurezza
Tool.dSideStep = EgtGetValInNotes( Tool.sUserNotes, 'SIDESTEP') or floor( Tool.dMaxMaterial / 3) -- se non settato nell'utensile, considero un terzo della lunghezza
Tool.dStep = EgtGetValInNotes( Tool.sUserNotes, 'STEP') or floor( Tool.dMaxMaterial / 3) -- se non settato nell'utensile, considero un terzo della lunghezza
Tool.dSideStep = EgtGetValInNotes( Tool.sUserNotes, 'SIDESTEP') or ( Tool.dThick - 1) -- se non settato nell'utensile, considero spessore catena meno 1mm di sicurezza
end
end
+6 -1
View File
@@ -120,6 +120,7 @@ function FaceData.GetFacesInfo( Proc, Part)
local frHV, dFaceWidth, dFaceHeight = BeamLib.GetFaceHvRefDim( Proc.id, i - 1, Part)
-- frame OCS faccia
Faces[i].vtFrameHV = frHV
-- TODO valutare se Width e Height si possono rimuovere
-- larghezza OCS faccia
Faces[i].dWidth = dFaceWidth
-- altezza OCS faccia
@@ -195,6 +196,7 @@ local function GetTunnelFaces( Proc)
EgtCutSurfTmPlane( TunnelAddedFaces.MiddleFaceTm.id, Proc.Faces[i].ptCenter, -Proc.Faces[i].vtN, false, GDB_ID.ROOT)
end
TunnelAddedFaces.MiddleFaceTm.Type = 'Tunnel'
-- TODO aggiungere anche informazioni Edges tunnel??
return TunnelAddedFaces
end
@@ -379,6 +381,8 @@ local function GetSideFaces( Proc, MainFaces)
error( 'GetSideFaces : Topology not implemented')
end
-- TODO da sistemare come Bottom e Long
local idBottomFace = GDB_ID.NULL
if Proc.Topology.sFamily ~= 'Tunnel' then
if MainFaces.BottomFace then
@@ -396,7 +400,6 @@ local function GetSideFaces( Proc, MainFaces)
LongFaces = GetLongFaces( Proc, MainFaces)
end
for i = 1, Proc.nFct do
if not idBottomFace or i ~= ( idBottomFace + 1) then
local bIsSideFace = true
@@ -413,6 +416,8 @@ local function GetSideFaces( Proc, MainFaces)
end
end
-- TODO aggiungere anche informazioni Edges??
return SideFaces
end
+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
-------------------------------------------------------------------------------------------------------------