- in MachiningLib.FindBlade si restituisce il BladeEngagement, se presente

- in BLADETOWASTE.GetEdgeToMachine aggiunta la possibilità di restituire l'n-esimo lato della lista ordinata; in GetSingleCutStrategy si tenta di cambiare lato se il con il primo set non si è trovato alcun utensile; altre piccole correzioni
- in FACEBYBLADE refactoring per contemplare i vari casi di inversione
This commit is contained in:
luca.mazzoleni
2025-11-07 10:15:01 +01:00
parent 15db75dfad
commit 4ce77a4792
4 changed files with 80 additions and 41 deletions
+24 -19
View File
@@ -343,6 +343,12 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
Cutting.bInvert = false
end
-- ToolInvert
if Cutting.sBladeEngagement == 'DownUp' then
Cutting.bToolInvert = true
Cutting.bInvert = not Cutting.bInvert
end
-- analisi fattibilità lavorazione dal lato opposto
if OppositeToolDirectionMode ~= 'Disabled' then
@@ -372,11 +378,12 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
OppositeToolDirectionMode = 'Disabled'
-- la direzione di percorrenza del lato deve essere verso l'alto; bInvert va considerata perchè inverte la direzione di percorrenza
if ( Cutting.bInvert and Cutting.vtEdgeDirection:getZ() > 100 * GEO.EPS_SMALL)
-- il BladeEngagement non deve cambiare, altrimenti è inutile invertire la direzione
if ( sBladeEngagementOpposite == Cutting.sBladeEngagement)
and ( Cutting.bInvert and Cutting.vtEdgeDirection:getZ() > 100 * GEO.EPS_SMALL)
or ( ( not Cutting.bInvert) and Cutting.vtEdgeDirection:getZ() < -100 * GEO.EPS_SMALL) then
OppositeToolDirectionMode = 'Enabled'
Cutting.sBladeEngagement = sBladeEngagementOpposite
end
end
@@ -422,8 +429,10 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
if Cutting.dMaxRadialOffset > 10 * GEO.EPS_SMALL then
-- taglio a ghigliottina
if bIsTopBlade and ( Cutting.dRadialOffsetGuillotine < Cutting.dMaxRadialOffset - 10 * GEO.EPS_SMALL) then
dDepthToMachine = Cutting.dDepthToMachine + Cutting.dRadialOffsetGuillotine
Cutting.sEdgeUsage = 'Guillotine'
-- taglio ridotto
else
dDepthToMachine = Cutting.dDepthToMachine + Cutting.dMaxRadialOffset
@@ -432,17 +441,19 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
end
end
-- si ritesta la fattibilità del taglio con le nuove profondità
local EdgeToMachineForEngagement = EdgeToMachine
if OppositeToolDirectionMode == 'Enabled' then
EdgeToMachineForEngagement = EdgeToMachineOpposite
end
local bIsApplicable, sBladeEngagement = MachiningLib.GetBladeEngagement( FaceToMachine, EdgeToMachineForEngagement, Part, TOOLS[Cutting.nToolIndex], dDepthToMachine)
if bIsApplicable then
Cutting.sBladeEngagement = sBladeEngagement
else
Cutting.sEdgeUsage = 'Standard'
dDepthToMachine = Cutting.dDepthToMachine
-- se cambiata la profondità dDepthToMachine, si ritesta la fattibilità del taglio
if Cutting.sEdgeUsage ~= 'Standard' then
local EdgeToMachineForEngagement = EdgeToMachine
if OppositeToolDirectionMode == 'Enabled' then
EdgeToMachineForEngagement = EdgeToMachineOpposite
end
local bIsApplicable, sBladeEngagement = MachiningLib.GetBladeEngagement( FaceToMachine, EdgeToMachineForEngagement, Part, TOOLS[Cutting.nToolIndex], dDepthToMachine)
-- se non fattibile o cambiano le condizioni BladeEngagement, non si riduce
if not ( bIsApplicable and ( sBladeEngagement == Cutting.sBladeEngagement)) then
Cutting.sEdgeUsage = 'Standard'
dDepthToMachine = Cutting.dDepthToMachine
end
end
-- offset radiale (cambia se taglio opposto)
@@ -453,12 +464,6 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
end
end
-- ToolInvert
if Cutting.sBladeEngagement == 'DownUp' then
Cutting.bToolInvert = true
Cutting.bInvert = not Cutting.bInvert
end
-- completamento
Cutting.dCompletionPercentage = ( 1 - Cutting.dResidualDepth / Cutting.dDepthToMachine) * 100