- in MachiningLib migliorie a FindBlade
- migliorata BLADETOWASTE - in FACEBYBLADE la residualDepth si esprime rispetto alla DephToMachine passata e non rispetto all'elevazione del lato
This commit is contained in:
@@ -319,6 +319,7 @@ function MachiningLib.FindBlade( Proc, ToolSearchParameters)
|
||||
ToolSearchParameters.bForceLongcutBlade = ToolSearchParameters.bForceLongcutBlade or false
|
||||
|
||||
local nBestToolIndex
|
||||
local dBestToolResidualDepth = 0
|
||||
for i = 1, #TOOLS do
|
||||
local bIsToolCompatible = false
|
||||
|
||||
@@ -333,19 +334,40 @@ function MachiningLib.FindBlade( Proc, ToolSearchParameters)
|
||||
end
|
||||
|
||||
if bIsToolCompatible then
|
||||
if not nBestToolIndex then
|
||||
-- TODO gestire accorciamento massimo materiale per inclinazione
|
||||
local dCurrentResidualDepth = ToolSearchParameters.dElevation - TOOLS[i].dMaxDepth
|
||||
if not nBestToolIndex or ( dBestToolResidualDepth > 0 and dCurrentResidualDepth <= 10 * GEO.EPS_SMALL) then
|
||||
nBestToolIndex = i
|
||||
dBestToolResidualDepth = dCurrentResidualDepth
|
||||
else
|
||||
-- prediligo utensile per tagli lunghi, se richiesto
|
||||
if ToolSearchParameters.bForceLongcutBlade and not TOOLS[nBestToolIndex].bIsUsedForLongCut and TOOLS[i].bIsUsedForLongCut then
|
||||
nBestToolIndex = i
|
||||
dBestToolResidualDepth = dCurrentResidualDepth
|
||||
else
|
||||
-- entrambi completi
|
||||
if dBestToolResidualDepth <= 10 * GEO.EPS_SMALL and dCurrentResidualDepth <= 10 * GEO.EPS_SMALL then
|
||||
-- si sceglie quello con le performance migliori
|
||||
if TOOLS[i].dPerformanceIndex > TOOLS[nBestToolIndex].dPerformanceIndex + 10 * GEO.EPS_SMALL then
|
||||
nBestToolIndex = i
|
||||
dBestToolResidualDepth = dCurrentResidualDepth
|
||||
end
|
||||
-- entrambi incompleti
|
||||
elseif dBestToolResidualDepth > 10 * GEO.EPS_SMALL and dCurrentResidualDepth > 10 * GEO.EPS_SMALL then
|
||||
-- si sceglie quello che lavora di più
|
||||
if dCurrentResidualDepth > dBestToolResidualDepth then
|
||||
nBestToolIndex = i
|
||||
dBestToolResidualDepth = dCurrentResidualDepth
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ToolInfo.nToolIndex = nBestToolIndex
|
||||
|
||||
ToolInfo.dResidualDepth = dBestToolResidualDepth
|
||||
|
||||
return ToolInfo
|
||||
end
|
||||
|
||||
|
||||
@@ -114,7 +114,6 @@ function STR0005.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
Strategy.Result = {}
|
||||
Strategy.Result.sInfo = ''
|
||||
Blade.Result = {}
|
||||
local Cutting = {}
|
||||
local dMRRBlade = 0
|
||||
local dCompletionPercentage = 0
|
||||
|
||||
@@ -204,10 +203,7 @@ function STR0005.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
if #Blade.Result == 0 and not bLeaveWasteAttached then
|
||||
local bDropWholeWaste = Strategy.Parameters.sCuttingStrategy == 'DROP_WHOLE_WASTE'
|
||||
local OptionalParameters = { bDropWholeWaste = bDropWholeWaste, dMaxWasteVolume = Strategy.Parameters.dMaxWasteVolume, dMaxWasteLength = Strategy.Parameters.dMaxWasteLength}
|
||||
Blade.Result.Sorted = BladeToWaste.Make( Proc, Part, OptionalParameters)
|
||||
|
||||
-- TODO la BladeToWaste dovrà restituire la dCompletionPercentage
|
||||
dCompletionPercentage = Blade.Result.Sorted[#Blade.Result.Sorted].dCompletionPercentage
|
||||
Blade.Result.Sorted, dCompletionPercentage = BladeToWaste.Make( Proc, Part, OptionalParameters)
|
||||
end
|
||||
|
||||
-- aggiunta lavorazioni
|
||||
|
||||
@@ -20,6 +20,7 @@ EgtOutLog( ' BLADETOWASTE started', 1)
|
||||
|
||||
function BLADETOWASTE.Make( Proc, Part, OptionalParameters)
|
||||
local Result = {}
|
||||
local dCompletionPercentage = 0
|
||||
|
||||
-- parametri opzionali e default
|
||||
local nToolIndex = OptionalParameters.nToolIndex
|
||||
@@ -27,13 +28,18 @@ function BLADETOWASTE.Make( Proc, Part, OptionalParameters)
|
||||
local dMaxWasteVolume = OptionalParameters.dMaxWasteVolume or 0
|
||||
local dMaxWasteLength = OptionalParameters.dMaxWasteLength or 0
|
||||
|
||||
-- dimensioni feature
|
||||
local dFeatureVolume = FeatureLib.GetFeatureVolume( Proc, Part)
|
||||
local dFeatureMaxDimension = max( Proc.b3Box:getDimX(), Proc.b3Box:getDimY())
|
||||
local bIsFeatureSmall = dFeatureVolume < dMaxWasteVolume + 10 * GEO.EPS_SMALL
|
||||
and dFeatureMaxDimension < dMaxWasteLength + 10 * GEO.EPS_SMALL
|
||||
|
||||
-- si taglia tutto lo scarto in una sola lavorazione
|
||||
if Proc.nFct == 1 and ( bIsFeatureSmall or bDropWholeWaste) then
|
||||
local Cutting = {}
|
||||
local EdgeToMachine = {}
|
||||
local dDepthToMachine = 0
|
||||
local ToolInfo = {}
|
||||
-- ricerca utensile
|
||||
if not nToolIndex then
|
||||
local ToolSearchParameters = {}
|
||||
@@ -42,21 +48,27 @@ function BLADETOWASTE.Make( Proc, Part, OptionalParameters)
|
||||
EdgeToMachine = Proc.Faces[1].Edges[i]
|
||||
end
|
||||
end
|
||||
ToolSearchParameters.dElevation = EdgeToMachine.dElevation
|
||||
dDepthToMachine = EdgeToMachine.dElevation + BeamData.CUT_EXTRA
|
||||
ToolSearchParameters.dElevation = dDepthToMachine
|
||||
ToolSearchParameters.vtToolDirection = EdgeToMachine.vtN
|
||||
ToolSearchParameters.bAllowTopHead = true
|
||||
-- TODO bisognerà implementare anche la lama da sotto
|
||||
ToolSearchParameters.bAllowBottomHead = false
|
||||
ToolSearchParameters.bForceLongcutBlade = false
|
||||
local ToolInfo = MachiningLib.FindBlade( Proc, ToolSearchParameters)
|
||||
ToolInfo = MachiningLib.FindBlade( Proc, ToolSearchParameters)
|
||||
nToolIndex = ToolInfo.nToolIndex
|
||||
end
|
||||
|
||||
local OptionalParametersFaceByBlade = { dDepthToMachine = EdgeToMachine.dElevation + BeamData.CUT_EXTRA}
|
||||
local Cutting = FaceByBlade.Make( Proc, Part, Proc.Faces[1], EdgeToMachine, OptionalParametersFaceByBlade)
|
||||
table.insert( Result, Cutting)
|
||||
if ToolInfo.dResidualDepth < 10 * GEO.EPS_SMALL then
|
||||
local OptionalParametersFaceByBlade = { dDepthToMachine = dDepthToMachine, nToolIndex = nToolIndex}
|
||||
Cutting = FaceByBlade.Make( Proc, Part, Proc.Faces[1], EdgeToMachine, OptionalParametersFaceByBlade)
|
||||
end
|
||||
if Cutting.bIsApplicable or bDropWholeWaste then
|
||||
table.insert( Result, Cutting)
|
||||
dCompletionPercentage = Cutting.dCompletionPercentage or dCompletionPercentage
|
||||
end
|
||||
|
||||
-- restituire tabella contenente lavorazioni, già con cloni se necessari
|
||||
return Result, dCompletionPercentage
|
||||
end
|
||||
|
||||
|
||||
@@ -81,8 +93,8 @@ function BLADETOWASTE.Make( Proc, Part, OptionalParameters)
|
||||
|
||||
|
||||
|
||||
|
||||
return Result
|
||||
-- restituire tabella contenente lavorazioni, già con cloni se necessari
|
||||
return Result, dCompletionPercentage
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -102,7 +102,7 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
|
||||
local bForceLongcutBlade = OptionalParameters.bForceLongcutBlade or false
|
||||
local dExtendAfterTail = OptionalParameters.dExtendAfterTail or 10000
|
||||
local dPocketHeight = OptionalParameters.dPocketHeight or 0
|
||||
local dDepthToMachine = min( OptionalParameters.dDepthToMachine or EdgeToMachine.dElevation, EdgeToMachine.dElevation)
|
||||
local dDepthToMachine = OptionalParameters.dDepthToMachine or EdgeToMachine.dElevation
|
||||
local bIsSplitFeature = OptionalParameters.bIsSplitFeature or false
|
||||
local bOppositeToolDirection = OptionalParameters.bOppositeToolDirection or false
|
||||
local sDepth = OptionalParameters.sDepth or 0
|
||||
@@ -204,7 +204,7 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
|
||||
end
|
||||
else
|
||||
Cutting.dDepthToMachine = TOOLS[Cutting.nToolIndex].dMaxDepth - 1
|
||||
Cutting.dResidualDepth = EdgeToMachine.dElevation - Cutting.dDepthToMachine
|
||||
Cutting.dResidualDepth = dDepthToMachine - Cutting.dDepthToMachine
|
||||
if bOppositeToolDirection then
|
||||
Cutting.dRadialOffset = -Cutting.dDepthToMachine
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user