- 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:
luca.mazzoleni
2025-01-31 17:23:11 +01:00
parent 2f1b56ddc6
commit 7eb83ccf79
4 changed files with 47 additions and 17 deletions
+20 -8
View File
@@ -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
-------------------------------------------------------------------------------------------------------------