Merge remote-tracking branch 'origin/develop' into feature/Cuts2FacesLessThan90deg

This commit is contained in:
luca.mazzoleni
2025-09-15 17:58:23 +02:00
19 changed files with 708 additions and 82 deletions
+13
View File
@@ -377,6 +377,7 @@ local function GetStrategies_Essetre( Proc)
---------------------------------------------------------------------
-- Feature : Head Cambered Profile (0-103)
elseif ID.IsHeadCamberedProfile( Proc) then
Strategies = { { sStrategyId = 'STR0015'}}
---------------------------------------------------------------------
-- Feature : Round Arch (0-104)
elseif ID.IsRoundArch( Proc) then
@@ -475,6 +476,18 @@ local function GetParameters_Essetre( Proc, sStrategyIdToGet)
local bDrillFromOneSide = ( EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q02', 'd') or 0) == 1
local sDrillingMode = EgtIf( bDrillFromOneSide, 'PREFER_ONE', 'AUTO')
table.insert( Parameters, { sName = 'sDrillingMode', sValue = sDrillingMode, sType = 's'})
-- Feature : Head Cambered Profile (0-103)
elseif ID.IsHeadCamberedProfile( Proc) then
local sUpperFaceStrategy = EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q01', 's') or '' -- Q01 = forza fresa
sUpperFaceStrategy = EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q02', 's') or sUpperFaceStrategy or 'AUTO' -- Q02 = forza lama (se entrambi attivi comanda la lama)
table.insert( Parameters, { sName = 'sUpperFaceStrategy' , sValue = sUpperFaceStrategy, sType = 's'})
local dDepthChamfer = EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q03', 'd') or 0
local dOverMaterial = EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q04', 'd') or 0
local bOnlyChamfer = ( EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q05', 'd') or 0) == 1
table.insert( Parameters, { sName = 'dDepthChamfer' , sValue = dDepthChamfer, sType = 'd'})
table.insert( Parameters, { sName = 'bOnlyChamfer' , sValue = bOnlyChamfer, sType = 'b'})
table.insert( Parameters, { sName = 'dOverMaterial' , sValue = dOverMaterial, sType = 'd'})
end
return Parameters
-6
View File
@@ -135,8 +135,6 @@ function BeamExec.GetToolsFromDB()
if not Tool.SetupInfo.dMaxMatDecrease then
Tool.SetupInfo.dMaxMatDecrease = 0
end
-- TODO sostituire la qualità numerica con una stringa??
Tool.nQuality = 1
Tool.sUUID = EgtTdbGetCurrToolParam( MCH_TP.UUID)
Tool.sUserNotes = EgtTdbGetCurrToolParam( MCH_TP.USERNOTES)
Tool.dMaxDepth = EgtTdbGetCurrToolMaxDepth() or Tool.dMaxMaterial
@@ -166,14 +164,12 @@ function BeamExec.GetToolsFromDB()
Tool.dSideStep = max( EgtGetValInNotes( Tool.sUserNotes, 'SIDESTEP', 'd') or floor( Tool.dDiameter / 3), 1) -- se non settato nell'utensile, considero un terzo del diametro, almeno 1mm
Tool.bIsPen = abs( Tool.dSpeed) < 5
Tool.dPerformanceIndex = ( Tool.dDiameter * Tool.dMaxMaterial) / Tool.dLength
Tool.nQuality = 4
-- recupero parametri propri delle lame
elseif sToolFamily == 'SAWBLADE' then
Tool.bIsUsedForLongCut = EgtGetValInNotes( Tool.sUserNotes, 'LONGCUT') == 1 or false -- false come valore di default
Tool.dStep = EgtGetValInNotes( Tool.sUserNotes, 'STEP', 'd') or Tool.dThickness -- se non settato nell'utensile, considero lo spessore lama
Tool.dSideStep = EgtGetValInNotes( Tool.sUserNotes, 'SIDESTEP', 'd') or Tool.dMaxMaterial -- se non settato nell'utensile, considero il massimo materiale
Tool.dPerformanceIndex = 1 / ( Tool.dDiameter * Tool.dLength)
Tool.nQuality = 5
-- recupero parametri propri delle motoseghe
elseif sToolFamily == 'MORTISE' then
Tool.dDistance = EgtTdbGetCurrToolParam( MCH_TP.DIST) or 90 -- 90mm dimensione standard aggregato catena
@@ -184,14 +180,12 @@ function BeamExec.GetToolsFromDB()
Tool.dCornerRadius = EgtTdbGetCurrToolParam( MCH_TP.CORNRAD)
Tool.dWidth = Tool.dDiameter
Tool.dPerformanceIndex = 1 / Tool.dLength
Tool.nQuality = 2
end
-- drillbit
else
Tool.dStep = EgtGetValInNotes( Tool.sUserNotes, 'STEP', 'd') or ( Tool.dMaxMaterial / 3) -- se non settato nell'utensile, considero un terzo del tagliente
Tool.dSideStep = Tool.dDiameter -- si utilizza SOLO per i calcoli del MRR
Tool.dPerformanceIndex = Tool.dDiameter / Tool.dLength
Tool.nQuality = 4
end
-- se tutti i dati necessari sono disponibili, inserisco utensile nella lista globale degli utensili disponibili
+53 -37
View File
@@ -573,48 +573,64 @@ function FeatureLib.GetFeatureCompletionIndex( dCompletionPercentage)
end
-------------------------------------------------------------------------------------------------------------
-- funzione che restituisce qualità della lavorazione in base agli utensili utilizzati
function FeatureLib.GetFeatureQuality( sTypeTools)
local nQuality = 5
local TypeTools = EgtSplitString( sTypeTools)
-- indice in base a utensile
for i=1, #TypeTools do
if TypeTools[i] == 'Blade' or TypeTools[i] == 'Drill' then
nQuality = min( nQuality, 5)
elseif TypeTools[i] == 'Mill' then
nQuality = min( nQuality, 4)
elseif TypeTools[i] == 'Chainsaw' then
nQuality = min( nQuality, 2)
else
nQuality = min( nQuality, 1)
end
end
-- se si utilizzano più utensili si perde in qualità
if #TypeTools > 1 then
nQuality = max( nQuality - 1, 0.5)
end
return nQuality
end
-------------------------------------------------------------------------------------------------------------
function FeatureLib.GetStrategyQuality( Machinings)
function FeatureLib.GetStrategyQuality( Parameter)
local nQuality = 0
local dQualityNumerator = 0
local dQualityDenominator = 0
for i = 1, #Machinings do
local Machining = Machinings[i]
local dWeightedQuality = TOOLS[Machining.nToolIndex].nQuality * Machining.dLengthToMachine
if Machining.bIsApplicable then
dQualityNumerator = dQualityNumerator + dWeightedQuality
dQualityDenominator = dQualityDenominator + Machining.dLengthToMachine
-- se viene passata una tabella, si calcola media pesata di tutte le lavorazioni
if type( Parameter) == "table" then
local Machinings = Parameter
local dQualityNumerator = 0
local dQualityDenominator = 0
for i = 1, #Machinings do
local Machining = Machinings[i]
local dWeightedQuality = FeatureLib.GetStrategyQuality( TOOLS[Machining.nToolIndex].sFamily) * Machining.dLengthToMachine
if Machining.bIsApplicable then
dQualityNumerator = dQualityNumerator + dWeightedQuality
dQualityDenominator = dQualityDenominator + Machining.dLengthToMachine
end
end
nQuality = dQualityNumerator / dQualityDenominator
-- se viene passato un tag, si ritorna direttamente il voto
elseif type( Parameter) == "string" then
local sMachiningTag = Parameter
-- #### STATI DI LAVORAZIONE AGGREGATI #### --
-- FINE = lavorazione eccellente, non dovrebbero esscerci scheggiature
if sMachiningTag == 'FINE' then
nQuality = 5
-- STD = lavorazione accettabile, potrebbe avere scheggiature minime
elseif sMachiningTag == 'STD' then
nQuality = 3
-- SEMI = lavorato accettabile, la lavorazione potrebbe avere scheggiature minime, mancano piccoli dettagli alla lavorazione
elseif sMachiningTag == 'SEMI' then
nQuality = 2.5
-- ROUGH =
elseif sMachiningTag == 'ROUGH' then
nQuality = 1
-- #### UTENSILI DI LAVORAZIONE UTILIZZATI #### --
elseif sMachiningTag == 'SAWBLADE' then
nQuality = 5
elseif sMachiningTag == 'DRILLBIT' then
nQuality = 4
elseif sMachiningTag == 'MILL' then
nQuality = 3
elseif sMachiningTag == 'MORTISE' then
nQuality = 1
-- #### STATI DI LAVORAZIONE DETTAGLIATI #### --
elseif sMachiningTag == 'DrillBothSide' or sMachiningTag == 'DrillBlind' then
nQuality = 5
elseif sMachiningTag == 'MillPlusBladeAS' then
nQuality = 4.5
elseif sMachiningTag == 'ChainPlusBladeAS' or sMachiningTag == 'MillPlusMillAS' then
nQuality = 4
elseif sMachiningTag == 'DrillOneSide' then
nQuality = 3
else
nQuality = 0
end
else
nQuality = 0
end
nQuality = dQualityNumerator / dQualityDenominator
return nQuality
end
+1 -1
View File
@@ -602,7 +602,7 @@
"nGrp": 0,
"TopologyList" : [
{ "sName": "Feature",
"StrategyList" : [ ]
"StrategyList" : [ { "sStrategyId": "STR0015" } ]
}
]
},
+4 -4
View File
@@ -166,7 +166,7 @@ local function GetSplitStrategy( Proc, Part)
-- TODO considerare di tagliare con il massimo materiale possibile per non salire troppo in Z (macchine tipo PF), oppure non scendere troppo (tipo Kairos)
-- BladeSideSingle (taglio di lama singolo di fianco)
if Machining[1].bIsApplicable and ( dMaxMatBladeSideSingle - BeamData.CUT_EXTRA) > Part.dWidth + 10 * GEO.EPS_SMALL then
Strategy.Result.nQuality = TOOLS[Machining[1].ToolInfo.nToolIndex].nQuality
Strategy.Result.nQuality = FeatureLib.GetStrategyQuality( 'SAWBLADE')
Machining.sTypeMachining = 'BladeSideSingle'
Machining[2].bIsApplicable = false
Machining[3].bIsApplicable = false
@@ -175,7 +175,7 @@ local function GetSplitStrategy( Proc, Part)
-- TODO considerare di tagliare con il massimo materiale possibile per non salire troppo in Z (macchine tipo PF), oppure non scendere troppo (tipo Kairos)
-- BladeSideDouble (taglio di lama doppio di fianco)
elseif Machining[1].bIsApplicable and ( dMaxMatBladeSideDouble - BeamData.CUT_EXTRA) > Part.dWidth + 10 * GEO.EPS_SMALL then
Strategy.Result.nQuality = TOOLS[Machining[1].ToolInfo.nToolIndex].nQuality
Strategy.Result.nQuality = FeatureLib.GetStrategyQuality( 'SAWBLADE')
Strategy.Result.dMRR = Strategy.Result.dMRR/2
Machining.sTypeMachining = 'BladeSideDouble'
Machining[2].bIsApplicable = false
@@ -184,7 +184,7 @@ local function GetSplitStrategy( Proc, Part)
return Machining
-- BladeHorizontalSingle (taglio di lama singolo orizzontale)
elseif Machining[1].bIsApplicable and ( dMaxMatBladeHorizontalSingle - BeamData.CUT_EXTRA) > Part.dHeight + 10 * GEO.EPS_SMALL then
Strategy.Result.nQuality = TOOLS[Machining[1].ToolInfo.nToolIndex].nQuality
Strategy.Result.nQuality = FeatureLib.GetStrategyQuality( 'SAWBLADE')
Machining.sTypeMachining = 'BladeHorizontalSingle'
Machining[2].bIsApplicable = false
Machining[3].bIsApplicable = false
@@ -193,7 +193,7 @@ local function GetSplitStrategy( Proc, Part)
-- BladeHorizontalDouble (taglio di lama doppio orizzontale)
elseif Machining[1].bIsApplicable and Machining[2].bIsApplicable and
( dMaxMatBladeHorizontalSingle + dMaxMatBladeHorizontalDouble - BeamData.CUT_EXTRA) > Part.dHeight + 10 * GEO.EPS_SMALL then
Strategy.Result.nQuality = 0.5 * TOOLS[Machining[1].ToolInfo.nToolIndex].nQuality + 0.5 * TOOLS[Machining[2].ToolInfo.nToolIndex].nQuality
Strategy.Result.nQuality = FeatureLib.GetStrategyQuality( 'SAWBLADE')
Strategy.Result.dMRR = Strategy.Result.dMRR/2
Machining.sTypeMachining = 'BladeHorizontalDouble'
Machining[1].ToolInfo.dMaxMatBladeFromTop = dMaxMatBladeHorizontalSingle
+6 -2
View File
@@ -268,7 +268,11 @@ local function GetTenonMachiningResult( Proc, Result)
TotalResult.sStatus = Result.Milling.sStatus
TotalResult.nCompletionIndex = FeatureLib.GetFeatureCompletionIndex( 100)
TotalResult.dMRR = ( Result.Milling.dMRR + Result.Cutting.dMRR) / 2
TotalResult.nQuality = FeatureLib.GetFeatureQuality( EgtIf( Strategy.Machining.bCuttingWithMill, 'Mill,Mill', 'Mill,Blade'))
if Strategy.Machining.nMillingPathsNeeded > Strategy.Parameters.nMaxMillingPaths then
TotalResult.nQuality = FeatureLib.GetStrategyQuality( 'STD')
else
TotalResult.nQuality = FeatureLib.GetStrategyQuality( 'FINE')
end
TotalResult.nFeatureRotationIndex = GetFeatureRotationIndex( Proc)
TotalResult.dTimeToMachine = Result.Milling.dTimeToMachine + Result.Cutting.dTimeToMachine
TotalResult.sInfo = ''
@@ -277,7 +281,7 @@ local function GetTenonMachiningResult( Proc, Result)
TotalResult.sStatus = 'Not-Completed'
TotalResult.nCompletionIndex = FeatureLib.GetFeatureCompletionIndex( 50)
TotalResult.dMRR = Result.Cutting.dMRR
TotalResult.nQuality = FeatureLib.GetFeatureQuality( EgtIf( Strategy.Machining.bCuttingWithMill, 'Mill', 'Blade'))
TotalResult.nQuality = FeatureLib.GetStrategyQuality( 'FINE')
TotalResult.sInfo = 'Tenon not completed'
TotalResult.dTimeToMachine = Result.Cutting.dTimeToMachine
-- strategia non applicabile, manca il taglio di lama sulla lunghezza del tenone
+4 -9
View File
@@ -100,7 +100,6 @@ local function CalcMachinedPercentage( Proc, Machining)
end
-------------------------------------------------------------------------------------------------------------
-- TODO vedere se sostituire GetFeatureQuality con valore da utensile; MillOnAggregate che qualità ha? da gestire in info utensile
-- TODO va gestita meglio la decisione delle facce da lavorare
local function GetBestPocketingStrategy( Proc)
-- imposto parametri di ricerca utensile in base a topologia
@@ -109,7 +108,7 @@ local function GetBestPocketingStrategy( Proc)
local ToolSearchParameters = {}
ToolSearchParameters.sMillShape = 'STANDARD'
Machining.sTypeMachining = 'None' -- Bottom-Side1-Side2\ Bottom-Side1\ Bottom-Side2\ Side1-Side2\ Bottom\ Side1 \ Side2 \ None
Strategy.Result.nQuality = FeatureLib.GetFeatureQuality( 'Mill')
Strategy.Result.nQuality = FeatureLib.GetStrategyQuality( 'STD')
-- caso speciale Tunnel che non ha faccia bottom
if Proc.Topology.sName == 'Tunnel-4-Through' then
@@ -165,10 +164,6 @@ local function GetBestPocketingStrategy( Proc)
Milling.ToolInfo = {}
Milling.ToolInfo = MachiningLib.FindMill( Proc, ToolSearchParameters)
if Milling.ToolInfo.nToolIndex then
-- se utensile scelto è su aggregato, ricalcolo la qualità
if TOOLS[Milling.ToolInfo.nToolIndex].SetupInfo.bToolOnAggregate then
Strategy.Result.nQuality = FeatureLib.GetFeatureQuality( 'MillOnAggregate')
end
Milling.bIsApplicable = true
local ParametersMRR = {}
ParametersMRR.nToolIndex = Milling.ToolInfo.nToolIndex
@@ -328,7 +323,7 @@ local function GetBestPocketingStrategy( Proc)
Strategy.Result.sStatus = 'Completed'
end
Strategy.Result.nCompletionIndex = FeatureLib.GetFeatureCompletionIndex( 100)
Strategy.Result.nQuality = FeatureLib.GetFeatureQuality( 'RadiusOnCornerLeft')
Strategy.Result.nQuality = FeatureLib.GetStrategyQuality( 'SEMI')
Strategy.Result.dMRR = Machining[3].dMRR
if Proc.MainFaces.TunnelAddedFaces then
Machining[3].ToolInfo.dResidualDepth = -( Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Faces[1].dElevation + BeamData.MILL_OVERLAP)
@@ -349,7 +344,7 @@ local function GetBestPocketingStrategy( Proc)
Strategy.Result.sStatus = 'Completed'
end
Strategy.Result.nCompletionIndex = FeatureLib.GetFeatureCompletionIndex( 100)
Strategy.Result.nQuality = FeatureLib.GetFeatureQuality( 'RadiusOnCornerLeft')
Strategy.Result.nQuality = FeatureLib.GetStrategyQuality( 'SEMI')
Strategy.Result.dMRR = Machining[4].dMRR
if Proc.MainFaces.TunnelAddedFaces then
Machining[4].ToolInfo.dResidualDepth = -( Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Faces[1].dElevation + BeamData.MILL_OVERLAP)
@@ -375,7 +370,7 @@ local function GetBestPocketingStrategy( Proc)
Machining[3].ToolInfo.dResidualDepth = Machining[3].ToolInfo.dResidualDepth - Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Faces[1].dElevation + dExtraMachDepth
Machining[4].ToolInfo.dResidualDepth = Machining[4].ToolInfo.dResidualDepth - Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Faces[1].dElevation + dExtraMachDepth
Strategy.Result.nCompletionIndex = FeatureLib.GetFeatureCompletionIndex( 100)
Strategy.Result.nQuality = FeatureLib.GetFeatureQuality( 'RadiusOnCornerLeft')
Strategy.Result.nQuality = FeatureLib.GetStrategyQuality( 'SEMI')
Strategy.Result.dMRR = ( Machining[3].dMRR + Machining[4].dMRR) / 2
Machining[1].bIsApplicable = false
Machining[2].bIsApplicable = false
+2 -2
View File
@@ -227,7 +227,7 @@ local function GetTenonMachiningResult( Proc, Result)
TotalResult.sStatus = Result.Milling.sStatus
TotalResult.nCompletionIndex = FeatureLib.GetFeatureCompletionIndex( 100)
TotalResult.dMRR = ( Result.Milling.dMRR + Result.Cutting.dMRR) / 2
TotalResult.nQuality = FeatureLib.GetFeatureQuality( EgtIf( Strategy.Machining.bCuttingWithMill, 'Mill,Mill', 'Mill,Blade'))
TotalResult.nQuality = FeatureLib.GetStrategyQuality( EgtIf( Strategy.Machining.bCuttingWithMill, 'STD', 'FINE'))
TotalResult.nFeatureRotationIndex = GetFeatureRotationIndex( Proc)
TotalResult.dTimeToMachine = Result.Milling.dTimeToMachine + Result.Cutting.dTimeToMachine
TotalResult.sInfo = ''
@@ -236,7 +236,7 @@ local function GetTenonMachiningResult( Proc, Result)
TotalResult.sStatus = 'Not-Completed'
TotalResult.nCompletionIndex = FeatureLib.GetFeatureCompletionIndex( 50)
TotalResult.dMRR = Result.Cutting.dMRR
TotalResult.nQuality = FeatureLib.GetFeatureQuality( EgtIf( Strategy.Machining.bCuttingWithMill, 'Mill', 'Blade'))
TotalResult.nQuality = FeatureLib.GetStrategyQuality( EgtIf( Strategy.Machining.bCuttingWithMill, 'MILL', 'SAWBLADE'))
TotalResult.sInfo = 'Tenon not completed'
TotalResult.dTimeToMachine = Result.Cutting.dTimeToMachine
-- strategia non applicabile, manca il taglio di lama sulla lunghezza del tenone
+3 -3
View File
@@ -160,7 +160,7 @@ function GetMortiseMachiningResult( Proc, Result)
TotalResult.sStatus = Result.Milling.sStatus
TotalResult.nCompletionIndex = FeatureLib.GetFeatureCompletionIndex( 100)
TotalResult.dMRR = ( Result.Milling.dMRR + Result.Cutting.dMRR) / 2
TotalResult.nQuality = FeatureLib.GetFeatureQuality( EgtIf( Strategy.Machining.bCuttingWithMill, 'Mill,Mill', 'Mill,Blade'))
TotalResult.nQuality = FeatureLib.GetStrategyQuality( EgtIf( Strategy.Machining.bCuttingWithMill, 'STD', 'FINE'))
TotalResult.nFeatureRotationIndex = GetFeatureRotationIndex( Proc)
TotalResult.sInfo = ''
-- lavorazione mortasa completa
@@ -168,7 +168,7 @@ function GetMortiseMachiningResult( Proc, Result)
TotalResult.sStatus = Result.Milling.sStatus
TotalResult.nCompletionIndex = FeatureLib.GetFeatureCompletionIndex( 100)
TotalResult.dMRR = Result.Milling.dMRR
TotalResult.nQuality = FeatureLib.GetFeatureQuality( 'Mill')
TotalResult.nQuality = FeatureLib.GetStrategyQuality( 'MILL')
TotalResult.nFeatureRotationIndex = GetFeatureRotationIndex( Proc)
TotalResult.sInfo = ''
-- lavorazione incompleta
@@ -176,7 +176,7 @@ function GetMortiseMachiningResult( Proc, Result)
TotalResult.sStatus = 'Not-Completed'
TotalResult.nCompletionIndex = FeatureLib.GetFeatureCompletionIndex( 50)
TotalResult.dMRR = Result.Cutting.dMRR
TotalResult.nQuality = FeatureLib.GetFeatureQuality( EgtIf( Strategy.Machining.bCuttingWithMill, 'Mill', 'Blade'))
TotalResult.nQuality = FeatureLib.GetStrategyQuality( EgtIf( Strategy.Machining.bCuttingWithMill, 'MILL', 'SAWBLADE'))
TotalResult.sInfo = 'Mortise not completed'
-- strategia non applicabile, manca il taglio di lama sulla lunghezza del Mortise
else
+1 -1
View File
@@ -36,7 +36,7 @@ local function GetBestPocketingStrategy( Proc, Part)
local ToolSearchParameters = {}
Machining.sTypeMachining = 'None' -- Bottom\ Side1\ Side2\ Side1-Side2\ None
Strategy.Result.nQuality = FeatureLib.GetFeatureQuality( 'Mill')
Strategy.Result.nQuality = FeatureLib.GetStrategyQuality( 'MILL')
-- in caso sia una mortasa frontale, bisogna lavorare il taglio
if Proc.FeatureInfo.bIsFrontMortise then
+1 -1
View File
@@ -156,7 +156,7 @@ local function GetArcStrategy( Proc, Part)
Strategy.Result.sStatus = 'Completed'
Strategy.Result.nCompletionIndex = 5
Strategy.Result.dMRR = MachiningLib.GetToolMRR( Machining[1].ToolInfo or Machining[2].ToolInfo)
Strategy.Result.nQuality = FeatureLib.GetFeatureQuality( 'Mill')
Strategy.Result.nQuality = FeatureLib.GetStrategyQuality( 'MILL')
Strategy.Result.sInfo = ''
return Machining
+8 -8
View File
@@ -65,7 +65,7 @@ local function GetDrillingStrategy( Proc, Part)
Strategy.Result.sStatus = 'Completed'
Strategy.Result.nCompletionIndex = 5
Strategy.Result.dMRR = MachiningLib.GetToolMRR( Machining[1].ToolInfo or Machining[2].ToolInfo)
Strategy.Result.nQuality = FeatureLib.GetFeatureQuality( 'Drill')
Strategy.Result.nQuality = FeatureLib.GetStrategyQuality( EgtIf( bDouble, 'DrillBothSide', 'DrillOneSide'))
Strategy.Result.sInfo = ''
else
Strategy.Result.sStatus = 'Not-Completed'
@@ -74,7 +74,7 @@ local function GetDrillingStrategy( Proc, Part)
Strategy.Result.nCompletionIndex = FeatureLib.GetFeatureCompletionIndex( dMachinedPrercentage)
Strategy.Result.sInfo = 'Drill not complete, left ' .. tostring( 100 - ceil( dMachinedPrercentage)) .. '%'
Strategy.Result.dMRR = MachiningLib.GetToolMRR( Machining[1].ToolInfo or Machining[2].ToolInfo)
Strategy.Result.nQuality = FeatureLib.GetFeatureQuality( 'Drill')
Strategy.Result.nQuality = FeatureLib.GetStrategyQuality( EgtIf( bDouble, 'DrillBothSide', 'DrillOneSide'))
end
end
-- se lavorazione verticale
@@ -125,7 +125,7 @@ local function GetDrillingStrategy( Proc, Part)
Strategy.Result.nCompletionIndex = 5
Strategy.Result.sInfo = ''
Strategy.Result.dMRR = MachiningLib.GetToolMRR( Machining[1].ToolInfo)
Strategy.Result.nQuality = FeatureLib.GetFeatureQuality( 'Drill')
Strategy.Result.nQuality = FeatureLib.GetStrategyQuality( 'DrillBothSide')
-- se utensile 1 esegue completamente
elseif Drilling.ToolInfo.nToolIndex and Drilling.ToolInfo.dResidualDepth < 10 * GEO.EPS_SMALL and
@@ -139,7 +139,7 @@ local function GetDrillingStrategy( Proc, Part)
Strategy.Result.sStatus = 'Completed'
Strategy.Result.nCompletionIndex = 5
Strategy.Result.dMRR = MachiningLib.GetToolMRR( Machining[1].ToolInfo)
Strategy.Result.nQuality = FeatureLib.GetFeatureQuality( 'Drill')
Strategy.Result.nQuality = FeatureLib.GetStrategyQuality( 'DrillOneSide')
Strategy.Result.sInfo = ''
-- se utensile 2 esegue completamente
elseif Drilling2.ToolInfo.nToolIndex and Drilling2.ToolInfo.dResidualDepth < 10 * GEO.EPS_SMALL and
@@ -154,7 +154,7 @@ local function GetDrillingStrategy( Proc, Part)
Strategy.Result.sStatus = 'Completed'
Strategy.Result.nCompletionIndex = 5
Strategy.Result.dMRR = MachiningLib.GetToolMRR( Machining[1].ToolInfo)
Strategy.Result.nQuality = FeatureLib.GetFeatureQuality( 'Drill')
Strategy.Result.nQuality = FeatureLib.GetStrategyQuality( 'DrillOneSide')
Strategy.Result.sInfo = ''
-- se possono lavorare entrambi
elseif Drilling.ToolInfo.nToolIndex and Drilling2.ToolInfo.nToolIndex then
@@ -183,7 +183,7 @@ local function GetDrillingStrategy( Proc, Part)
end
-- voto
Strategy.Result.dMRR = MachiningLib.GetToolMRR( Machining[1].ToolInfo)
Strategy.Result.nQuality = FeatureLib.GetFeatureQuality( 'Drill')
Strategy.Result.nQuality = FeatureLib.GetStrategyQuality( 'DrillBothSide')
-- se utensile 1 non completo
elseif Drilling.ToolInfo.nToolIndex and ( Strategy.Parameters.sDrillingMode ~= 'FORCE_TWO' or Proc.FeatureInfo.bIsDrillOpen) then
Drilling.sDepth = Proc.FeatureInfo.dDrillLen - Drilling.ToolInfo.dResidualDepth
@@ -199,7 +199,7 @@ local function GetDrillingStrategy( Proc, Part)
Strategy.Result.nCompletionIndex = FeatureLib.GetFeatureCompletionIndex( dMachinedPrercentage)
Strategy.Result.sInfo = 'Drill not complete, left ' .. tostring( 100 - ceil( dMachinedPrercentage)) .. '%'
Strategy.Result.dMRR = MachiningLib.GetToolMRR( Machining[1].ToolInfo)
Strategy.Result.nQuality = FeatureLib.GetFeatureQuality( 'Drill')
Strategy.Result.nQuality = FeatureLib.GetStrategyQuality( 'DrillOneSide')
-- se utensile 2 non completo
elseif Drilling2.ToolInfo.nToolIndex and Strategy.Parameters.sDrillingMode ~= 'FORCE_TWO' then
Drilling2.sDepth = Proc.FeatureInfo.dDrillLen - Drilling2.ToolInfo.dResidualDepth
@@ -216,7 +216,7 @@ local function GetDrillingStrategy( Proc, Part)
Strategy.Result.nCompletionIndex = FeatureLib.GetFeatureCompletionIndex( dMachinedPrercentage)
Strategy.Result.sInfo = 'Drill not complete, left ' .. tostring( 100 - ceil( dMachinedPrercentage)) .. '%'
Strategy.Result.dMRR = MachiningLib.GetToolMRR( Machining[1].ToolInfo)
Strategy.Result.nQuality = FeatureLib.GetFeatureQuality( 'Drill')
Strategy.Result.nQuality = FeatureLib.GetStrategyQuality( 'DrillOneSide')
else
local sMessage
-- se non sono state trovate punte
+2 -2
View File
@@ -131,13 +131,13 @@ local function GetDrillingWithMillStrategy( Proc, Part)
Strategy.Result.sStatus = 'Completed'
Strategy.Result.nCompletionIndex = 5
Strategy.Result.sInfo = ''
Strategy.Result.nQuality = FeatureLib.GetFeatureQuality( 'Mill')
Strategy.Result.nQuality = FeatureLib.GetStrategyQuality( 'MILL')
else
Strategy.Result.sStatus = 'Not-Completed'
local dResidualPrercentage = 100 * ( dResidual / Proc.FeatureInfo.dDrillLen)
Strategy.Result.nCompletionIndex = FeatureLib.GetFeatureCompletionIndex( 100 - dResidualPrercentage)
Strategy.Result.sInfo = 'Machining not complete, left ' .. tostring( ceil( dResidualPrercentage)) .. '%'
Strategy.Result.nQuality = FeatureLib.GetFeatureQuality( 'Mill')
Strategy.Result.nQuality = FeatureLib.GetStrategyQuality( 'MILL')
end
-- se son state trovate frese compatibili
else
+1 -1
View File
@@ -77,7 +77,7 @@ function STR0014.Make( bAddMachining, Proc, Part, CustomParameters)
Strategy.Result.nCompletionIndex = FeatureLib.GetFeatureCompletionIndex( 100)
local Parameters = { nToolIndex = Strategy.Machining.ToolInfo.nToolIndex}
Strategy.Result.dMRR = MachiningLib.GetToolMRR( Parameters)
Strategy.Result.nQuality = FeatureLib.GetFeatureQuality( 'Mill')
Strategy.Result.nQuality = FeatureLib.GetStrategyQuality( 'MILL')
else
Strategy.Result = FeatureLib.GetStrategyResultNotApplicable()
end
+145
View File
@@ -0,0 +1,145 @@
{
"sStrategyId": "STR0009",
"sStrategyName": "Mill Heading",
"ParameterList" : [
{
"sName": "dDepthChamfer",
"sNameNge": "DEPTH_CHAMFER",
"sValue": "0",
"sDescriptionShort": "Depth Chamfer",
"sDescriptionLong": "Depth of the V-Mill to execute chamfers on cut-edges",
"sType": "d",
"sMessageId": " ",
"sMinUserLevel": "1"
},
{
"sName": "bOnlyChamfer",
"sNameNge": "ONLY_CHAMFER",
"sValue": "false",
"sDescriptionShort": "Only Chamfer",
"sDescriptionLong": "Execute the chamfer only, no other machining",
"sType": "b",
"sMessageId": " ",
"sMinUserLevel": "1"
},
{
"sName": "dOverMaterial",
"sNameNge": "OVERMAT",
"sValue": "0",
"sDescriptionShort": "Overmaterial",
"sDescriptionLong": "",
"sType": "d",
"sMessageId": " ",
"sMinUserLevel": "1"
},
{
"sName": "dMaxCornerRadius",
"sNameNge": "MAX_CORNER_RADIUS",
"sValue": "15",
"sDescriptionShort": "Max radius left on corners",
"sDescriptionLong": "Radius-limit left by the tool at each corner of the feature",
"sType": "d",
"sMessageId": " ",
"sMinUserLevel": "1"
},
{
"sName": "bExecRough",
"sNameNge": "EXEC_ROUGH",
"sValue": "0",
"sDescriptionShort": "Execute cut to remove material",
"sDescriptionLong": "",
"sType": "b",
"sMessageId": " ",
"sMinUserLevel": "1"
},
{
"sName": "bForceStrip",
"sNameNge": "FORCE_STRIP",
"sValue": "false",
"sDescriptionShort": "Force strip",
"sDescriptionLong": "Enable the parameter to force the software to leave a strip to sustain the piece",
"sType": "b",
"sMessageId": " ",
"sMinUserLevel": "1"
},
{
"sName": "dStripWidth",
"sNameNge": "STRIP_WIDTH",
"sValue": "0",
"sDescriptionShort": "Strip width",
"sDescriptionLong": "Width of the strip in case if foreseen from the machining",
"sType": "d",
"sMessageId": " ",
"sMinUserLevel": "1"
},
{
"sName": "sConcaveFaceStrategy",
"sNameNge": "CONCAVE_FACE",
"sValue": "AUTO",
"sDescriptionShort": "Cutting Strategy",
"sDescriptionLong": "",
"sType": "combo",
"sMinUserLevel": "1",
"Choices": [
{
"sValue": "AUTO",
"sDescriptionShort": "Automatic",
"sDescriptionLong": "",
"sMessageId": ""
},
{
"sValue": "BLADE_FORCED",
"sDescriptionShort": "Blade forced",
"sDescriptionLong": "",
"sMessageId": ""
},
{
"sValue": "MILL_FORCED",
"sDescriptionShort": "Mill forced",
"sDescriptionLong": "",
"sMessageId": ""
}
]
},
{
"sName": "sMillingList",
"sNameNge": "PROFILE_TOOL_LIST",
"sValue": "",
"sDescriptionShort": "Available mill to machine the profile",
"sDescriptionLong": "",
"sType": "d",
"sMessageId": " ",
"sMinUserLevel": "1"
},
{
"sName": "dMaxWasteLength",
"sNameNge": "MAX_WASTE_LENGTH",
"sValue": "300",
"sDescriptionShort": "Maximum Waste Length",
"sDescriptionLong": "",
"sType": "d",
"sMessageId": " ",
"sMinUserLevel": "1"
},
{
"sName": "dMaxWasteVolume",
"sNameNge": "MAX_WASTE_VOLUME",
"sValue": "6000000",
"sDescriptionShort": "Maximum Waste Volume",
"sDescriptionLong": "",
"sType": "d",
"sMessageId": " ",
"sMinUserLevel": "1"
},
{
"sName": "bReduceBladePath",
"sNameNge": "REDUCE_BLADE_PATH",
"sValue": "true",
"sDescriptionShort": "Use entire blade diameter to shorten path",
"sDescriptionLong": "",
"sType": "b",
"sMessageId": " ",
"sMinUserLevel": "1"
}
]
}
+457
View File
@@ -0,0 +1,457 @@
-- Strategia: STR0015
-- Descrizione
-- Fresatura di contorno
-- Feature tipo Profilo arcuato, Convesso, Concavo, Arco
-- carico librerie
local BeamLib = require( 'BeamLib')
local BeamData = require( 'BeamData')
local MachiningLib = require( 'MachiningLib')
local FeatureLib = require( 'FeatureLib')
local ID = require( 'Identity')
-- strategie di base
local BladeToWaste = require('BLADETOWASTE')
-- Tabella per definizione modulo
local STR0015 = {}
local Strategy = {}
---------------------------------------------------------------------
local function GetSawCutData( AuxId, vtNF)
-- comincio con la normale a 45deg
local vtNP = Vector3d( vtNF)
for i = 1, 3 do
if vtNP[i] > GEO.EPS_SMALL then
vtNP[i] = 1
elseif vtNP[i] < -GEO.EPS_SMALL then
vtNP[i] = -1
end
end
vtNP:normalize()
-- assegno un punto di passaggio
local ptStart = EgtSP( AuxId, GDB_ID.ROOT) + vtNP * 5.0
-- determino asse di rotazione
local vtRot = - Y_AX()
if vtNF:getX() < 0 then vtRot = - vtRot end
if vtNF:getZ() < -0.1 then
vtRot = - vtRot
elseif vtNF:getY() < -0.1 then
vtRot:rotate( X_AX(), 90)
elseif vtNF:getY() > 0.1 then
vtRot:rotate( X_AX(), -90)
end
-- miglioro l'inclinazione (ripartendo da faccia perpendicolare asse trave)
vtNP[2] = 0 vtNP[3] = 0
local dRot = 45
for i = 1, 4 do
local vtNP2 = Vector3d( vtNP)
vtNP2:rotate( vtRot, dRot)
local frRef = Frame3d( ptStart, vtNP2)
local b3Box = EgtGetBBoxRef( AuxId, GDB_BB.STANDARD, frRef)
if b3Box:getMax():getZ() < -3 then
vtNP = Vector3d( vtNP2)
end
dRot = dRot / 2
end
-- restituisco i dati del piano
return ptStart, vtNP
end
-------------------------------------------------------------------------------------------------------------
local function GetRoughStrategy( Proc, Part, bSaveAddedGeometries)
local Machining = {}
local Result = {}
-- ====== Taglio di sgrossatura generale su tutto il profilo ======
local vtNF = EgtSurfTmFacetNormVersor( Proc.id, Proc.nFct-1, GDB_ID.ROOT)
local nAddGroupId = BeamLib.GetAddGroup( Part.id)
-- aggiungo piano di sgrossatura e lo lavoro
local ptStart, vtNP = GetSawCutData( Proc.idAddAuxGeom, vtNF)
local AddId = EgtSurfTmPlaneInBBox( nAddGroupId, ptStart, vtNP, Part.b3Part, GDB_RT.GLOB)
if not bSaveAddedGeometries then
EgtSetLevel( AddId, GDB_LV.TEMP)
end
-- creo piano di taglio sulla testa del tenone
local OptionalParameters = { dMaxWasteVolume = Strategy.Parameters.dMaxWasteVolume,
dMaxWasteLength = Strategy.Parameters.dMaxWasteLength,
bReduceBladePath = Strategy.Parameters.bReduceBladePath
}
Machining, Result = BladeToWaste.Make( AddId, Part, OptionalParameters)
-- se non ci sono lavorazioni, provo con fresa
if not Machining then
-- TODO
end
return Machining, Result
end
-------------------------------------------------------------------------------------------------------------
local function GetEdgeWithCornerStrategy( Proc, Part)
local Machining = {}
local Result = {}
if Strategy.Parameters.sConcaveFaceStrategy == 'AUTO' or Strategy.Parameters.sConcaveFaceStrategy == 'BLADE_FORCED' then
end
return Machining, Result
end
-------------------------------------------------------------------------------------------------------------
local function GetChamferStrategy( Proc, Part)
local Machining = {}
local Result = {}
if Strategy.Parameters.dDepthChamfer > 100 * GEO.EPS_SMALL then
end
return Machining, Result
end
-------------------------------------------------------------------------------------------------------------
-- TODO gestire il caso in cui non si trova l'utensile
local function GetArcStrategy( Proc, Part)
local Machining = {}
local Result = {}
local ToolSearchParameters = {}
-- recupero i dati della curva e del profilo
local dDepth = abs( EgtCurveThickness( Proc.idAddAuxGeom))
local vtExtr = EgtCurveExtrusion( Proc.idAddAuxGeom, GDB_RT.GLOB)
local bToolInvert = ( vtExtr:getZ() < -0.1)
local bIsHorizontal = abs( vtExtr:getZ()) < 10 * GEO.EPS_SMALL
local bIsFeatureDown = Proc.AffectedFaces.bBottom and not Proc.AffectedFaces.bTop
local bIsFeatureBack = Proc.AffectedFaces.bBack and not Proc.AffectedFaces.bFront
local bForceStrip = Strategy.Parameters.bForceStrip
local dDimStrip = EgtIf( Strategy.Parameters.dStripWidth < 100 * GEO.EPS_SMALL, nil, Strategy.Parameters.dStripWidth)
local bExecStrip = false
-- se la lavorazione si trova nella parte inferiore o in battuta dietro, il codolo va sempre lasciato
if bIsFeatureDown or bIsFeatureBack or bForceStrip then
if bIsFeatureDown or bIsFeatureBack then
dDimStrip = dDimStrip or max( BeamData.DIM_STRIP or 5, 5)
else
dDimStrip = dDimStrip or max( BeamData.DIM_STRIP_SMALL or 5, 1)
end
bExecStrip = true
end
if not bExecStrip then
dDimStrip = 0
end
-- la passata di finitura c'è sempre
local nPassages = 1
-- si verifica se fare passaggio di sgrossatura con fresa
if not bExecStrip and Strategy.Parameters.dOverMaterial > 100 * GEO.EPS_SMALL then
nPassages = 2
end
-- ciclo su numero passate (2 in caso di sgrossatura + finitura)
for nCycle = nPassages, 1, -1 do
local nMaxDiamMill = EgtIf( nCycle == 1, Strategy.Parameters.dMaxCornerRadius * 2, nil)
local sTypeTool = EgtIf( nCycle == 1 and nPassages == 2, 'MillingFinish', 'Milling')
-- se lavorazione orizzontale
if bIsHorizontal then
local bDouble
local Milling = MachiningLib.InitMachiningParameters( MCH_MY.MILLING)
Milling.bIsApplicable = false
ToolSearchParameters = {}
ToolSearchParameters.sMillShape = 'STANDARD'
ToolSearchParameters.dElevation = EgtIf( bExecStrip, ( dDepth - dDimStrip) / 2, dDepth + BeamData.MILL_OVERLAP)
ToolSearchParameters.vtToolDirection = EgtIf( bToolInvert, -vtExtr, vtExtr)
ToolSearchParameters.AvailableToolList = MachiningLib.GetAvailableToolList( Proc, Strategy.Parameters.sMillingList, sTypeTool)
ToolSearchParameters.dMaxToolDiameter = nMaxDiamMill
Milling.ToolInfo = {}
Milling.ToolInfo = MachiningLib.FindMill( Proc, ToolSearchParameters)
-- se posso lavorare in una passata, ma utensile trovato non completa la lavorazione,
-- allora provo a cercare utensile con massimo materiale sufficiente per fare le due passate, magari trova un utensile più prestante
if Milling.ToolInfo.dResidualDepth > 10 * GEO.EPS_SMALL and not bExecStrip then
bDouble = true
ToolSearchParameters.dElevation = ( dDepth + BeamData.MILL_OVERLAP) / 2
ToolSearchParameters.vtToolDirection = EgtIf( bToolInvert, -vtExtr, vtExtr)
Milling.ToolInfo = {}
Milling.ToolInfo = MachiningLib.FindMill( Proc, ToolSearchParameters)
end
Milling.vtToolDirection = ToolSearchParameters.vtToolDirection
if nCycle == 2 then
Milling.dRadialOffset = Strategy.Parameters.dOverMaterial
end
if bDouble or bExecStrip then
if bDouble then
Milling.sDepth = ( dDepth + BeamData.MILL_OVERLAP) / 2
else
Milling.sDepth = ( dDepth - dDimStrip) / 2
end
table.insert( Machining, Milling)
local Milling2 = BeamLib.TableCopyDeep( Milling)
Milling2.bOtherDirection = true
table.insert( Machining, Milling2)
else
Milling.sDepth = dDepth + BeamData.MILL_OVERLAP
table.insert( Machining, Milling)
end
-- se lavorazione verticale
else
-- si cerca utensile 1
local Milling = {}
Milling.bIsApplicable = false
ToolSearchParameters = {}
ToolSearchParameters.sMillShape = 'STANDARD'
ToolSearchParameters.dElevation = dDepth + BeamData.MILL_OVERLAP
ToolSearchParameters.vtToolDirection = EgtIf( bToolInvert, -vtExtr, vtExtr)
ToolSearchParameters.AvailableToolList = MachiningLib.GetAvailableToolList( Proc, Strategy.Parameters.sMillingList, sTypeTool)
ToolSearchParameters.dMaxToolDiameter = nMaxDiamMill
Milling.ToolInfo = {}
Milling.ToolInfo = MachiningLib.FindMill( Proc, ToolSearchParameters)
if nCycle == 2 then
Milling.dRadialOffset = Strategy.Parameters.dOverMaterial
end
Milling.vtToolDirection = ToolSearchParameters.vtToolDirection
-- si cerca utensile 2
local Milling2 = {}
Milling2.bIsApplicable = false
ToolSearchParameters = {}
ToolSearchParameters.sMillShape = 'STANDARD'
ToolSearchParameters.dElevation = dDepth + BeamData.MILL_OVERLAP
ToolSearchParameters.vtToolDirection = EgtIf( bToolInvert, vtExtr, -vtExtr)
ToolSearchParameters.AvailableToolList = MachiningLib.GetAvailableToolList( Proc, Strategy.Parameters.sMillingList, sTypeTool)
ToolSearchParameters.dMaxToolDiameter = nMaxDiamMill
Milling2.ToolInfo = {}
Milling2.ToolInfo = MachiningLib.FindMill( Proc, ToolSearchParameters)
Milling2.bOtherDirection = true
if nCycle == 2 then
Milling2.dRadialOffset = Strategy.Parameters.dOverMaterial
end
Milling2.vtToolDirection = ToolSearchParameters.vtToolDirection
-- se serve codolo
if bExecStrip then
-- se a disposizione entrambi gli utensili
if Milling.ToolInfo.nToolIndex and Milling2.ToolInfo.nToolIndex then
table.insert( Machining, Milling)
table.insert( Machining, Milling2)
-- se disponibile solo primo utensile
elseif Milling.ToolInfo.nToolIndex then
table.insert( Machining, Milling)
-- se disponibile solo secondo utensile
elseif Milling2.ToolInfo.nToolIndex then
table.insert( Machining, Milling2)
-- nessun utensile disponibile
else
-- non si fa nulla
end
-- altrimenti senza codolo
else
-- se utensile 1 esegue completamente
if Milling.ToolInfo.nToolIndex and Milling.ToolInfo.dResidualDepth < 10 * GEO.EPS_SMALL then
table.insert( Machining, Milling)
-- se utensile 2 esegue completamente
elseif Milling2.ToolInfo.nToolIndex and Milling2.ToolInfo.dResidualDepth < 10 * GEO.EPS_SMALL then
table.insert( Machining, Milling2)
-- se possono lavorare entrambi
elseif Milling.ToolInfo.nToolIndex and Milling2.ToolInfo.nToolIndex then
table.insert( Machining, Milling)
table.insert( Machining, Milling2)
-- se utensile 1 non completo
elseif Milling.ToolInfo.nToolIndex then
table.insert( Machining, Milling)
-- se utensile 2 non completo
elseif Milling2.ToolInfo.nToolIndex then
table.insert( Machining, Milling2)
end
end
end
end
-- TODO VOTO DA FARE!!!!
Result.sStatus = 'Completed'
Result.nCompletionIndex = 5
Result.dMRR = 1
Result.nQuality = FeatureLib.GetStrategyQuality( 'MILL')
Result.sInfo = ''
return Machining, Result
end
-------------------------------------------------------------------------------------------------------------
local function GetFeatureResult()
local Result = {}
Result.sStatus = 'Completed'
Result.nCompletionIndex = 5
Result.dMRR = 1
Result.nQuality = FeatureLib.GetStrategyQuality( 'MILL')
Result.sInfo = ''
return Result
end
-------------------------------------------------------------------------------------------------------------
function STR0015.Make( bAddMachining, Proc, Part, CustomParameters)
-- carico parametri de default e li aggiorno con quelli passati dal chiamante (potrebbero non essere congruenti)
local StrategyLib = {}
StrategyLib.Config = STRATEGIES_CONFIG[CustomParameters.sStrategyId]
Strategy.sName = StrategyLib.Config.sStrategyId
Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, StrategyLib.Config)
Strategy.Chamfer = {}
Strategy.Chamfer.Machinings = {}
Strategy.Chamfer.Result = {}
Strategy.Result = {}
local bAreAllMachiningsAdded = true
-- calcolo se la lavorazione del tenone può essere spostata dopo taglio di coda
local dLengthOnX = Proc.b3Box:getDimX()
Strategy.bCanMoveAfterSplit = MachiningLib.CanMoveAfterSplitcut( dLengthOnX, Part)
-- recupero e verifico l'entità curva
local idAux = EgtGetInfo( Proc.id, 'AUXID', 'i')
if idAux then idAux = idAux + Proc.id end
if not idAux or ( EgtGetType( idAux) & GDB_FY.GEO_CURVE) == 0 then
local sErr = 'Error on process ' .. tostring( Proc.id) .. ' missing profile geometry'
EgtOutLog( sErr)
return false, sErr
end
Proc.idAddAuxGeom = idAux
-- lavorazione smussi
Strategy.Chamfer.Machinings, Strategy.Chamfer.Result = GetChamferStrategy( Proc, Part)
-- se non bisogna fare solo gli smussi, si calcolano le altre lavorazioni
if not Strategy.Parameters.bOnlyChamfer then
-- per tutti tranne che per feature RoundArc
if not ID.IsRoundArch( Proc) then
Strategy.RoughCut = {}
Strategy.RoughCut.Machinings = {}
Strategy.RoughCut.Result = {}
Strategy.EdgeWithCorner = {}
Strategy.EdgeWithCorner.Machinings = {}
Strategy.EdgeWithCorner.Result = {}
-- lavorazione taglio per sgrossare
Strategy.RoughCut.Machinings, Strategy.RoughCut.Result = GetRoughStrategy( Proc, Part, bAddMachining)
-- lavorazione degli estremi con angoli interni
Strategy.EdgeWithCorner.Machinings, Strategy.EdgeWithCorner.Result = GetEdgeWithCornerStrategy( Proc, Part)
end
-- lavorazione profilo (a meno che non si facciano solo smussi)
Strategy.Profile = {}
Strategy.Profile.Machinings = {}
Strategy.Profile.Result = {}
Strategy.Profile.Machinings, Strategy.Profile.Result = GetArcStrategy( Proc, Part)
end
Strategy.Result = GetFeatureResult()
if bAddMachining and Strategy.Result.sStatus ~= 'Not-Applicable' then
-- eventuali punti di spezzatura
local FeatureSplittingPoints = FeatureLib.GetFeatureSplittingPoints( Proc, Part)
-- lavorazione degli smussi
if Strategy.Chamfer.Machinings then
end
-- lavorazione di sgrezzatura di lama
if Strategy.RoughCut.Machinings then
-- se cutting da fare come svuotatura
if Strategy.RoughCut.Machinings.bCuttingWithMill then
-- TODO
-- taglio di lama
else
for i = 1, #Strategy.RoughCut.Machinings do
if Proc.AffectedFaces.bLeft and Strategy.bCanMoveAfterSplit then
Strategy.RoughCut.Machinings[i].sStage = 'AfterTail'
end
local bIsMachiningAdded = MachiningLib.AddMachinings( Proc, Strategy.RoughCut.Machinings[i])
if not bIsMachiningAdded then
bAreAllMachiningsAdded = false
end
end
end
end
-- lavorazione degli angoli interni
if Strategy.EdgeWithCorner.Machinings then
end
-- lavorazione del profilo
if Strategy.Profile.Machinings then
for i = 1, #Strategy.Profile.Machinings do
Strategy.Profile.Machinings[i].Geometry = {{ Proc.idAddAuxGeom, -1}}
Strategy.Profile.Machinings[i].nToolIndex = Strategy.Profile.Machinings[i].ToolInfo.nToolIndex
Strategy.Profile.Machinings[i].nType = MCH_MY.MILLING
Strategy.Profile.Machinings[i].dStartSafetyLength = 0
Strategy.Profile.Machinings[i].Steps = {}
Strategy.Profile.Machinings[i].Steps.dStep = TOOLS[Strategy.Profile.Machinings[i].ToolInfo.nToolIndex].dStep
Strategy.Profile.Machinings[i].Steps = MachiningLib.GetMachiningSteps( tonumber( Strategy.Profile.Machinings[i].sDepth), TOOLS[Strategy.Profile.Machinings[i].nToolIndex].dStep)
-- LeadIn / LeadOut
Strategy.Profile.Machinings[i].LeadIn = {}
Strategy.Profile.Machinings[i].LeadOut = {}
Strategy.Profile.Machinings[i].LeadIn.nType = MCH_MILL_LI.TANGENT
Strategy.Profile.Machinings[i].LeadOut.nType = MCH_MILL_LI.TANGENT
Strategy.Profile.Machinings[i].LeadIn.dTangentDistance = TOOLS[Strategy.Profile.Machinings[i].ToolInfo.nToolIndex].dDiameter / 2 + BeamData.COLL_SIC
Strategy.Profile.Machinings[i].LeadIn.dPerpDistance = 0
Strategy.Profile.Machinings[i].LeadIn.dStartAddLength = 0
Strategy.Profile.Machinings[i].LeadOut.dTangentDistance = TOOLS[Strategy.Profile.Machinings[i].ToolInfo.nToolIndex].dDiameter / 2 + BeamData.COLL_SIC
Strategy.Profile.Machinings[i].LeadOut.dPerpDistance = 0
Strategy.Profile.Machinings[i].LeadOut.dEndAddLength = 0
local dLengthOnX = Proc.b3Box:getDimX()
Strategy.bCanMoveAfterSplit = MachiningLib.CanMoveAfterSplitcut( dLengthOnX, Part)
if Proc.AffectedFaces.bLeft and Strategy.bCanMoveAfterSplit then
Strategy.Profile.Machinings[i].sStage = 'AfterTail'
end
-- preparo attacco/uscita in caso di spezzatura arco
Strategy.Profile.Machinings[i].LeadInForSplit = BeamLib.TableCopyDeep( Strategy.Profile.Machinings[i].LeadIn)
Strategy.Profile.Machinings[i].LeadOutForSplit = BeamLib.TableCopyDeep( Strategy.Profile.Machinings[i].LeadOut)
Strategy.Profile.Machinings[i].LeadInForSplit.nType = MCH_MILL_LI.LINEAR
Strategy.Profile.Machinings[i].LeadOutForSplit.nType = MCH_MILL_LI.LINEAR
Strategy.Profile.Machinings[i].LeadInForSplit.dTangentDistance = 0
Strategy.Profile.Machinings[i].LeadInForSplit.dPerpDistance = TOOLS[Strategy.Profile.Machinings[i].ToolInfo.nToolIndex].dDiameter / 2 + BeamData.COLL_SIC
Strategy.Profile.Machinings[i].LeadOutForSplit.dTangentDistance = 0
Strategy.Profile.Machinings[i].LeadOutForSplit.dPerpDistance = TOOLS[Strategy.Profile.Machinings[i].ToolInfo.nToolIndex].dDiameter / 2 + BeamData.COLL_SIC
-- sistemo il lato e la direzione di lavoro
if Strategy.Profile.Machinings[i].bOtherDirection then
Strategy.Profile.Machinings[i].bToolInvert = true
Strategy.Profile.Machinings[i].bInvert = EgtIf( TOOLS[Strategy.Profile.Machinings[i].ToolInfo.nToolIndex].bIsCCW, true, false)
Strategy.Profile.Machinings[i].nWorkside = EgtIf( TOOLS[Strategy.Profile.Machinings[i].ToolInfo.nToolIndex].bIsCCW, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT)
else
Strategy.Profile.Machinings[i].bInvert = EgtIf( TOOLS[Strategy.Profile.Machinings[i].ToolInfo.nToolIndex].bIsCCW, false, true)
Strategy.Profile.Machinings[i].nWorkside = EgtIf( TOOLS[Strategy.Profile.Machinings[i].ToolInfo.nToolIndex].bIsCCW, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT)
end
Strategy.Profile.Machinings[i].ptEdge1 = EgtSP( Proc.idAddAuxGeom, GDB_ID.ROOT)
Strategy.Profile.Machinings[i].ptEdge2 = EgtEP( Proc.idAddAuxGeom, GDB_ID.ROOT)
Strategy.Profile.Machinings[i].dEdgeLength = EgtCurveLength( Proc.idAddAuxGeom)
Strategy.Profile.Machinings[i].vtEdgeDirection = EgtSV( Proc.idAddAuxGeom, GDB_ID.ROOT) + EgtMV( Proc.idAddAuxGeom, GDB_ID.ROOT) + EgtEV( Proc.idAddAuxGeom, GDB_ID.ROOT)
Strategy.Profile.Machinings[i].dLengthOnX = Proc.b3Box:getDimX()
local MachiningToSplit = {}
table.insert( MachiningToSplit, Strategy.Profile.Machinings[i])
local MachiningResult = MachiningLib.GetSplitMachinings( MachiningToSplit, FeatureSplittingPoints, Part)
-- aggiunge lavorazione
for j = 1, #MachiningResult do
bAreAllMachiningsAdded = MachiningLib.AddMachinings( Proc, MachiningResult[j])
end
end
end
else
bAreAllMachiningsAdded = false
end
return bAreAllMachiningsAdded, Strategy.Result
end
-------------------------------------------------------------------------------------------------------------
return STR0015
+2 -1
View File
@@ -6,6 +6,7 @@
-- carico librerie
local BeamLib = require( 'BeamLib')
local BeamData = require( 'BeamData')
local FeatureLib = require( 'FeatureLib')
local MachiningLib = require( 'MachiningLib')
local SPLITCUT = require( 'SPLITCUT')
-- strategie di base
@@ -51,7 +52,7 @@ function TAILCUT.Make( bAddMachining, Proc, Part, CustomParameters)
Strategy.Result.nCompletionIndex = 5
Strategy.Result.dMRR = 1
-- TODO di quale utensile si deve impostare la qualità qui?
Strategy.Result.nQuality = 5
Strategy.Result.nQuality = FeatureLib.GetStrategyQuality( 'SAWBLADE')
Strategy.Result.sInfo = 'Split not possible'
end
end
+1
View File
@@ -14,6 +14,7 @@ STR0011 = Foratura
STR0012 = RidgeLap
STR0013 = Foratura con fresa (svuotatura)
STR0014 = Incisione con fresa/penna (Mark/text)
STR0015 = Profilo arcuato (Head Cambered Profile)
[Strategies]
; Processing , Gruppo , Topologia , Strategie
+4 -4
View File
@@ -125,7 +125,7 @@ function SPLITCUT.GetStrategy( Proc, Part, OptionalParameters)
-- TODO considerare di tagliare con il massimo materiale possibile per non salire troppo in Z (macchine tipo PF), oppure non scendere troppo (tipo Kairos)
-- BladeSideSingle (taglio di lama singolo di fianco)
if Machining[1].bIsApplicable and ( dMaxMatBladeSideSingle - BeamData.CUT_EXTRA) > Part.dWidth + 10 * GEO.EPS_SMALL then
Result.nQuality = TOOLS[Machining[1].ToolInfo.nToolIndex].nQuality
Result.nQuality = FeatureLib.GetStrategyQuality( 'SAWBLADE')
Machining.sTypeMachining = 'BladeSideSingle'
Machining[2].bIsApplicable = false
Machining[3].bIsApplicable = false
@@ -134,7 +134,7 @@ function SPLITCUT.GetStrategy( Proc, Part, OptionalParameters)
-- TODO considerare di tagliare con il massimo materiale possibile per non salire troppo in Z (macchine tipo PF), oppure non scendere troppo (tipo Kairos)
-- BladeSideDouble (taglio di lama doppio di fianco)
elseif Machining[1].bIsApplicable and ( dMaxMatBladeSideDouble - BeamData.CUT_EXTRA) > Part.dWidth + 10 * GEO.EPS_SMALL then
Result.nQuality = TOOLS[Machining[1].ToolInfo.nToolIndex].nQuality
Result.nQuality = FeatureLib.GetStrategyQuality( 'SAWBLADE')
Result.dMRR = Result.dMRR/2
Machining.sTypeMachining = 'BladeSideDouble'
Machining[2].bIsApplicable = false
@@ -143,7 +143,7 @@ function SPLITCUT.GetStrategy( Proc, Part, OptionalParameters)
return Machining, Result
-- BladeHorizontalSingle (taglio di lama singolo orizzontale)
elseif Machining[1].bIsApplicable and ( dMaxMatBladeHorizontalSingle - BeamData.CUT_EXTRA) > Part.dHeight + 10 * GEO.EPS_SMALL then
Result.nQuality = TOOLS[Machining[1].ToolInfo.nToolIndex].nQuality
Result.nQuality = FeatureLib.GetStrategyQuality( 'SAWBLADE')
Machining.sTypeMachining = 'BladeHorizontalSingle'
Machining[2].bIsApplicable = false
Machining[3].bIsApplicable = false
@@ -152,7 +152,7 @@ function SPLITCUT.GetStrategy( Proc, Part, OptionalParameters)
-- BladeHorizontalDouble (taglio di lama doppio orizzontale)
elseif Machining[1].bIsApplicable and Machining[2].bIsApplicable and
( dMaxMatBladeHorizontalSingle + dMaxMatBladeHorizontalDouble - BeamData.CUT_EXTRA) > Part.dHeight + 10 * GEO.EPS_SMALL then
Result.nQuality = 0.5 * TOOLS[Machining[1].ToolInfo.nToolIndex].nQuality + 0.5 * TOOLS[Machining[2].ToolInfo.nToolIndex].nQuality
Result.nQuality = FeatureLib.GetStrategyQuality( 'SAWBLADE')
Result.dMRR = Result.dMRR/2
Machining.sTypeMachining = 'BladeHorizontalDouble'
Machining[1].ToolInfo.dMaxMatBladeFromTop = dMaxMatBladeHorizontalSingle