in sawpluschain ulteriori correzioni al calcolo approccio e retrazione

This commit is contained in:
luca.mazzoleni
2024-04-04 12:40:59 +02:00
parent b5094daa43
commit e03896cfef
+23 -23
View File
@@ -4739,26 +4739,6 @@ function SawPlusChain.GetToolFromMachining( sMachiningName)
end
function SawPlusChain.GetSCC( vtMachiningDirection)
local nSCC = MCH_SCC.NONE
if AreSameVectorApprox( vtMachiningDirection, Z_AX()) then
nSCC = MCH_SCC.ADIR_ZP
elseif AreOppositeVectorApprox( vtMachiningDirection, Z_AX()) then
nSCC = MCH_SCC.ADIR_ZM
elseif AreSameVectorApprox( vtMachiningDirection, Y_AX()) then
nSCC = MCH_SCC.ADIR_YP
elseif AreOppositeVectorApprox( vtMachiningDirection, Y_AX()) then
nSCC = MCH_SCC.ADIR_YM
elseif AreSameVectorApprox( vtMachiningDirection, X_AX()) then
nSCC = MCH_SCC.ADIR_XP
elseif AreOppositeVectorApprox( vtMachiningDirection, X_AX()) then
nSCC = MCH_SCC.ADIR_XM
end
return nSCC
end
function SawPlusChain.GetVerticalSteps( Proc, Machining)
if not Proc.Pocket or not Proc.Pocket.Height then
error( 'Missing pocket depth')
@@ -4848,11 +4828,11 @@ function SawPlusChain.CalculateLeadInOut( Proc, Machining)
elseif bIsStartClosed then
LeadIn.StartAddLength = -dAddLengthToReduce
-- eventuale correzione per accorciamento maggiore di larghezza tasca
LeadOut.EndAddLength = BD.CUT_EXTRA + max( -LeadIn.StartAddLength - Proc.Pocket.Width, 0)
LeadOut.EndAddLength = max( -LeadIn.StartAddLength - Proc.Pocket.Width + 10 * BD.CUT_EXTRA, BD.CUT_EXTRA)
elseif bIsEndClosed then
LeadOut.EndAddLength = -dAddLengthToReduce
-- eventuale correzione per accorciamento maggiore di larghezza tasca
LeadIn.StartAddLength = BD.CUT_EXTRA + max( -LeadOut.EndAddLength - Proc.Pocket.Width, 0)
LeadIn.StartAddLength = max( -LeadOut.EndAddLength - Proc.Pocket.Width + 10 * BD.CUT_EXTRA, BD.CUT_EXTRA)
else
LeadIn.StartAddLength = BD.CUT_EXTRA
LeadOut.EndAddLength = BD.CUT_EXTRA
@@ -4936,6 +4916,26 @@ function SawPlusChain.ApplyMachining( Machining, sOperationNamePrefix, b3Raw)
end
function SawPlusChain.Saw.GetSCC( vtMachiningDirection)
local nSCC = MCH_SCC.NONE
if AreSameVectorApprox( vtMachiningDirection, Z_AX()) then
nSCC = MCH_SCC.ADIR_ZP
elseif AreOppositeVectorApprox( vtMachiningDirection, Z_AX()) then
nSCC = MCH_SCC.ADIR_ZM
elseif AreSameVectorApprox( vtMachiningDirection, Y_AX()) then
nSCC = MCH_SCC.ADIR_YP
elseif AreOppositeVectorApprox( vtMachiningDirection, Y_AX()) then
nSCC = MCH_SCC.ADIR_YM
elseif AreSameVectorApprox( vtMachiningDirection, X_AX()) then
nSCC = MCH_SCC.ADIR_XP
elseif AreOppositeVectorApprox( vtMachiningDirection, X_AX()) then
nSCC = MCH_SCC.ADIR_XM
end
return nSCC
end
function SawPlusChain.Saw.CalculateMachiningParameters( Proc)
local Cutting = {}
Cutting.CanApply = true
@@ -5009,7 +5009,7 @@ function SawPlusChain.Saw.CalculateMachiningParameters( Proc)
-- faceuse
Cutting.Faceuse = BL.GetNearestOrthoOpposite( Proc.Pocket.Direction)
-- SCC
Cutting.SCC = SawPlusChain.GetSCC( Proc.Pocket.Direction)
Cutting.SCC = SawPlusChain.Saw.GetSCC( Proc.Pocket.Direction)
-- angoli suggeriti
Cutting.SuggestedAngles = ''
-- asse bloccato