- modifiche parziali a SawPlusChain per implemento funzione Egt che fornisce informazioni rigurado ai lati

This commit is contained in:
luca.mazzoleni
2024-05-07 18:59:30 +02:00
parent 3dea3d9be2
commit 1572648a7e
3 changed files with 114 additions and 77 deletions
+103 -74
View File
@@ -4666,13 +4666,13 @@ function SawPlusChain.GetBottomFace( Proc)
end
function SawPlusChain.GetFaceToMachine( Proc)
if not Proc.Pocket.BottomFace or not Proc.Pocket.BottomFace.Id then
Proc.Pocket.BottomFace = SawPlusChain.GetBottomFace( Proc)
function SawPlusChain.GetLongFace( Proc)
if not Proc.MainFaces.BottomFace or not Proc.MainFaces.BottomFace.Id then
Proc.MainFaces.BottomFace = SawPlusChain.GetBottomFace( Proc)
end
-- facce adiacenti a quella di fondo, ordinate
local FacesAdjacentToBottom = BL.GetAdjacentFaces( Proc, Proc.Pocket.BottomFace.Id)
local FacesAdjacentToBottom = BL.GetAdjacentFaces( Proc, Proc.MainFaces.BottomFace.Id)
table.sort( FacesAdjacentToBottom, function( a, b) return a.LengthOnMainFace > b.LengthOnMainFace end)
-- si sceglie la faccia adiacente sul lato più lungo
@@ -4695,25 +4695,25 @@ end
function SawPlusChain.GetSideFaces( Proc)
if not Proc.Pocket.BottomFace or not Proc.Pocket.BottomFace.Id then
Proc.Pocket.BottomFace = SawPlusChain.GetBottomFace( Proc)
if not Proc.MainFaces.BottomFace or not Proc.MainFaces.BottomFace.Id then
Proc.MainFaces.BottomFace = SawPlusChain.GetBottomFace( Proc)
end
if not Proc.Pocket.FaceToMachine or not Proc.Pocket.FaceToMachine.Id then
Proc.Pocket.FaceToMachine = SawPlusChain.GetFaceToMachine( Proc)
if not Proc.MainFaces.LongFace or not Proc.MainFaces.LongFace.Id then
Proc.MainFaces.LongFace = SawPlusChain.GetLongFace( Proc)
end
-- facce adiacenti a quella di fondo, ordinate
local FacesAdjacentToBottom = BL.GetAdjacentFaces( Proc, Proc.Pocket.BottomFace.Id)
local FacesAdjacentToBottom = BL.GetAdjacentFaces( Proc, Proc.MainFaces.BottomFace.Id)
table.sort( FacesAdjacentToBottom, function( a, b) return a.LengthOnMainFace > b.LengthOnMainFace end)
-- si determina il criterio di scelta delle facce laterali
local FacesAdjacentToFaceToMachine = BL.GetAdjacentFaces( Proc, Proc.Pocket.FaceToMachine.Id)
local bIsFaceToMachineTheLargest = not ( Proc.Fct == 4 and #FacesAdjacentToFaceToMachine == 3)
local FacesAdjacentToLongFace = BL.GetAdjacentFaces( Proc, Proc.MainFaces.LongFace.Id)
local bIsLongFaceTheLargest = not ( Proc.Fct == 4 and #FacesAdjacentToLongFace == 3)
local SideFaces = {}
for i = 1, #FacesAdjacentToBottom do
if ( not bIsFaceToMachineTheLargest and i < #FacesAdjacentToBottom) or
( bIsFaceToMachineTheLargest and i > 2) then
if ( not bIsLongFaceTheLargest and i < #FacesAdjacentToBottom) or
( bIsLongFaceTheLargest and i > 2) then
table.insert( SideFaces, FacesAdjacentToBottom[i])
SideFaces[#SideFaces].Id = FacesAdjacentToBottom[i].Id
SideFaces[#SideFaces].Width = Proc.Face[FacesAdjacentToBottom[i].Id + 1].Width
@@ -4730,6 +4730,29 @@ function SawPlusChain.GetSideFaces( Proc)
end
function SawPlusChain.GetEdgeToMachine( sEdge, Proc, FaceToMachine)
-- TODO da modificare quando arriverà la funzione Egt che fornisce informazioni sui lati
local EdgeToMachine = {}
if sEdge == 'Bottom' then
EdgeToMachine.ToolDirection = Proc.MainFaces.BottomFace.VtN
EdgeToMachine.Length = FaceToMachine.Width
EdgeToMachine.AdjacentFaceId = FaceToMachine.Id
EdgeToMachine.Elevation = Proc.MainFaces.BottomFace.Elevation
EdgeToMachine.IsStartOpen = false
EdgeToMachine.IsEndOpen = false
elseif sEdge == 'SideStart' then
elseif sEdge == 'SideEnd' then
elseif sEdge == 'Opposite' then
end
return EdgeToMachine
end
function SawPlusChain.GetToolFromMachining( sMachiningName)
local Tool = {}
if EgtMdbSetCurrMachining( sMachiningName) then
@@ -4793,19 +4816,20 @@ function SawPlusChain.GetHorizontalSteps( Machining)
return HorizontalSteps
end
function SawPlusChain.IsStartOrEndClosed( Proc, Machining)
local bIsStartClosed = false
local bIsEndClosed = false
local bIsMortising = ( Machining.Type == MCH_OY.MORTISING)
if #( Proc.Pocket.SideFaces) == 2 then
if #( Proc.MainFaces.SideFaces) == 2 then
bIsStartClosed = true
bIsEndClosed = true
elseif #( Proc.Pocket.SideFaces) == 1 then
local CCWDirection = ( Machining.FaceToMachine.VtN ^ Proc.Pocket.BottomFace.VtN)
elseif #( Proc.MainFaces.SideFaces) == 1 then
local CCWDirection = ( Machining.FaceToMachine.VtN ^ Proc.MainFaces.BottomFace.VtN)
if Machining.ToolInvert or bIsMortising then
CCWDirection = - CCWDirection
end
if CCWDirection * Proc.Pocket.SideFaces[1].VtN > 10 * GEO.EPS_SMALL then
if CCWDirection * Proc.MainFaces.SideFaces[1].VtN > 10 * GEO.EPS_SMALL then
if Machining.Tool.IsCCW then
bIsStartClosed = true
else
@@ -4824,11 +4848,14 @@ function SawPlusChain.IsStartOrEndClosed( Proc, Machining)
end
function SawPlusChain.CalculateLeadInOut( Proc, Machining)
function SawPlusChain.CalculateLeadInOut( Proc, Machining, EdgeToMachine)
-- TODO implementare le funzioni di Tool Collision Avoidance (vedi wiki e FacesBysaw -> CalcLeadInOutPerpGeom)
-- si determina se l'inizio o la fine della lavorazione sono chiusi e l'eventuale riduzione da applicare
-- TODO da rimuovere quando arriverà la funzione Egt che fornisce informazioni sui lati
-- TODO sarà da rimuovere anche l'argomento 'Proc'
local bIsStartClosed, bIsEndClosed = SawPlusChain.IsStartOrEndClosed( Proc, Machining)
local bIsMortising = ( Machining.Type == MCH_OY.MORTISING)
local dAddLengthToReduce = 0
if bIsMortising then
@@ -4846,8 +4873,8 @@ function SawPlusChain.CalculateLeadInOut( Proc, Machining)
LeadOut.Type = MCH_MILL_LI.LINEAR
LeadIn.TangentDistance = 0
LeadOut.TangentDistance = 0
LeadIn.PerpDistance = Proc.Pocket.Depth + BD.CUT_SIC
LeadOut.PerpDistance = Proc.Pocket.Depth + BD.CUT_SIC
LeadIn.PerpDistance = EdgeToMachine.Elevation + BD.CUT_SIC
LeadOut.PerpDistance = EdgeToMachine.Elevation + BD.CUT_SIC
LeadIn.Elevation = 0
LeadOut.Elevation = 0
LeadIn.CompLength = 0
@@ -4858,11 +4885,11 @@ function SawPlusChain.CalculateLeadInOut( Proc, Machining)
elseif bIsStartClosed then
LeadIn.StartAddLength = -dAddLengthToReduce
-- eventuale correzione per accorciamento maggiore di larghezza tasca
LeadOut.EndAddLength = max( -LeadIn.StartAddLength - Proc.Pocket.Width + 10 * BD.CUT_EXTRA, BD.CUT_EXTRA)
LeadOut.EndAddLength = max( -LeadIn.StartAddLength - EdgeToMachine.Width + 10 * BD.CUT_EXTRA, BD.CUT_EXTRA)
elseif bIsEndClosed then
LeadOut.EndAddLength = -dAddLengthToReduce
-- eventuale correzione per accorciamento maggiore di larghezza tasca
LeadIn.StartAddLength = max( -LeadOut.EndAddLength - Proc.Pocket.Width + 10 * BD.CUT_EXTRA, BD.CUT_EXTRA)
LeadIn.StartAddLength = max( -LeadOut.EndAddLength - EdgeToMachine.Width + 10 * BD.CUT_EXTRA, BD.CUT_EXTRA)
else
LeadIn.StartAddLength = BD.CUT_EXTRA
LeadOut.EndAddLength = BD.CUT_EXTRA
@@ -4990,7 +5017,7 @@ function SawPlusChain.Saw.GetSCC( vtMachiningDirection)
end
function SawPlusChain.Saw.CalculateMachiningParameters( Proc)
function SawPlusChain.Saw.CalculateMachiningParameters( Proc, FaceToMachine, EdgeToMachine)
local Cutting = {}
Cutting.CanApply = true
Cutting.Message = ''
@@ -4999,27 +5026,28 @@ function SawPlusChain.Saw.CalculateMachiningParameters( Proc)
-- ricerca lavorazione
Cutting.Name = ML.FindCutting( 'HeadSide', true, false)
if not Cutting.Name then
Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. Proc.Pocket.Strategy .. ' not applicable - saw blade not found'
Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. Proc.Strategy.Name .. ' not applicable - saw blade not found'
Cutting.CanApply = false
EgtOutLog( Cutting.Message)
return Cutting
end
Cutting.Type = MCH_OY.MILLING
Cutting.Tool = SawPlusChain.GetToolFromMachining( Cutting.Name)
Cutting.FaceToMachine = Proc.Pocket.FaceToMachine
-- TODO serve?
Cutting.FaceToMachine = FaceToMachine
-- verifica dimensioni tasca compatibili
-- se tasca meno spessa della lama la strategia non è applicabile
if Cutting.Tool.Thickness > Proc.Pocket.Height + 10 * GEO.EPS_SMALL then
Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. Proc.Pocket.Strategy .. ' not applicable - pocket too narrow for saw blade thickness'
if Cutting.Tool.Thickness > FaceToMachine.Elevation + 10 * GEO.EPS_SMALL then
Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. Proc.Strategy.Name .. ' not applicable - pocket too narrow for saw blade thickness'
Cutting.CanApply = false
EgtOutLog( Cutting.Message)
return Cutting
end
if #( Proc.Pocket.SideFaces) > 1 then
if #( Proc.MainFaces.SideFaces) > 1 then
-- se tasca più stretta della lama la strategia non è applicabile
if Cutting.Tool.Diameter > Proc.Pocket.Width + 10 * GEO.EPS_SMALL then
Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. Proc.Pocket.Strategy .. ' not applicable - pocket too narrow for saw blade diameter'
if Cutting.Tool.Diameter > EdgeToMachine.Length + 10 * GEO.EPS_SMALL then
Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. Proc.Strategy.Name .. ' not applicable - pocket too narrow for saw blade diameter'
Cutting.CanApply = false
EgtOutLog( Cutting.Message)
return Cutting
@@ -5028,7 +5056,7 @@ function SawPlusChain.Saw.CalculateMachiningParameters( Proc)
-- parametri della lavorazione
-- direzione utensile
Cutting.Direction = Proc.Pocket.Direction
Cutting.Direction = EdgeToMachine.ToolDirection
-- lato di lavoro e inversioni
if Cutting.Tool.IsCCW then
Cutting.Workside = MCH_MILL_WS.RIGHT
@@ -5045,14 +5073,15 @@ function SawPlusChain.Saw.CalculateMachiningParameters( Proc)
Cutting.ToolInvert = false
end
-- profondità e offset radiale
if Cutting.Tool.MaxDepth > Proc.Pocket.Depth - 10 * GEO.EPS_SMALL then
Cutting.Depth = Proc.Pocket.Depth
-- TODO gestire elevazione negativa (determina come devo lavorare)
if Cutting.Tool.MaxDepth > abs( EdgeToMachine.Elevation) - 10 * GEO.EPS_SMALL then
Cutting.Depth = abs( EdgeToMachine.Elevation)
Cutting.RadialOffset = 0
else
Cutting.Depth = Cutting.Tool.MaxDepth
Cutting.RadialOffset = Proc.Pocket.Depth - Cutting.Depth
if Proc.Pocket.ApplyOnlySawblade then
Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : sawblade elevation (' .. EgtNumToString( Proc.Pocket.Depth, 1) .. ') bigger than max tool depth (' .. EgtNumToString( Cutting.Depth, 1) .. ')'
Cutting.RadialOffset = abs( EdgeToMachine.Elevation) - Cutting.Depth
if Proc.Strategy.ApplyOnlySawblade then
Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : sawblade elevation (' .. EgtNumToString( EdgeToMachine.Elevation, 1) .. ') bigger than max tool depth (' .. EgtNumToString( Cutting.Depth, 1) .. ')'
EgtOutLog( Cutting.Message)
end
end
@@ -5061,7 +5090,7 @@ function SawPlusChain.Saw.CalculateMachiningParameters( Proc)
Cutting.Steps.StepType = MCH_MILL_ST.ONEWAY
Cutting.MaxElev = Cutting.Steps.StepLength * Cutting.Steps.Count - 10 * GEO.EPS_SMALL
if Cutting.ToolInvert and Cutting.Steps.Count > 1 then
Cutting.LongitudinalOffset = - Proc.Pocket.Height
Cutting.LongitudinalOffset = - FaceToMachine.Elevation
else
Cutting.LongitudinalOffset = 0
end
@@ -5094,7 +5123,7 @@ function SawPlusChain.Saw.CalculateMachiningParameters( Proc)
-- eventuale avviso di danneggiamento pezzo successivo
local dOffsideLength = max( Cutting.LeadIn.StartAddLength, Cutting.LeadOut.EndAddLength) + Cutting.Tool.Diameter / 2 + 10 * GEO.EPS_SMALL
if ( not Proc.Tail or Proc.AdvTail) and Proc.AffectedFaces.Left and ( Proc.Pocket.DistanceToNextPart < dOffsideLength) then
if ( not Proc.Tail or Proc.AdvTail) and Proc.AffectedFaces.Left and ( Proc.DistanceToNextPart < dOffsideLength) then
local sDamageNextPieceMessage = 'Feature '.. Proc.FeatureId .. ' : sawblade can damage next piece.'
if #Cutting.Message > 0 then
Cutting.Message = Cutting.Message .. '\n' .. sDamageNextPieceMessage
@@ -5108,39 +5137,41 @@ function SawPlusChain.Saw.CalculateMachiningParameters( Proc)
end
function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc)
function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine, EdgeToMachine)
local Chainsawing = {}
Chainsawing.CanApply = true
Chainsawing.Message = ''
Chainsawing.ProcId = Proc.Id
-- ricerca lavorazione
Chainsawing.Name = ML.FindSawing( 'Sawing', Proc.Pocket.Depth)
-- TODO gestire elevazione negativa (determina come devo lavorare)
Chainsawing.Name = ML.FindSawing( 'Sawing', Proc.EdgeToMachine.Elevation)
if not Chainsawing.Name then
Chainsawing.Name = ML.FindSawing( 'Sawing', nil, nil, 'Longest')
end
if not Chainsawing.Name then
Chainsawing.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. Proc.Pocket.Strategy .. ' not applicable - chainsaw not found'
Chainsawing.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. Proc.Strategy.Name .. ' not applicable - chainsaw not found'
Chainsawing.CanApply = false
EgtOutLog( Chainsawing.Message)
return Chainsawing
end
Chainsawing.Type = MCH_OY.MORTISING
Chainsawing.Tool = SawPlusChain.GetToolFromMachining( Chainsawing.Name)
Chainsawing.FaceToMachine = Proc.Pocket.FaceToMachine
-- TODO serve??
Chainsawing.FaceToMachine = FaceToMachine
-- verifica dimensioni tasca compatibili
-- se tasca meno spessa della sega a catena la strategia non è applicabile
if Chainsawing.Tool.Thickness > Proc.Pocket.Height + 10 * GEO.EPS_SMALL then
Chainsawing.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. Proc.Pocket.Strategy .. ' not applicable - pocket too narrow for chainsaw thickness'
if Chainsawing.Tool.Thickness > FaceToMachine.Elevation + 10 * GEO.EPS_SMALL then
Chainsawing.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. Proc.Strategy.Name .. ' not applicable - pocket too narrow for chainsaw thickness'
Chainsawing.CanApply = false
EgtOutLog( Chainsawing.Message)
return Chainsawing
end
if #( Proc.Pocket.SideFaces) > 1 then
if #( Proc.MainFaces.SideFaces) > 1 then
-- se tasca più stretta della sega a catena la strategia non è applicabile
if Chainsawing.Tool.Width > Proc.Pocket.Width + 10 * GEO.EPS_SMALL then
Chainsawing.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. Proc.Pocket.Strategy .. ' not applicable - pocket too narrow for chainsaw width'
if Chainsawing.Tool.Width > EdgeToMachine.Length + 10 * GEO.EPS_SMALL then
Chainsawing.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. Proc.Strategy.Name .. ' not applicable - pocket too narrow for chainsaw width'
Chainsawing.CanApply = false
EgtOutLog( Chainsawing.Message)
return Chainsawing
@@ -5149,7 +5180,7 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc)
-- parametri della lavorazione
-- direzione utensile
Chainsawing.Direction = Proc.Pocket.Direction
Chainsawing.Direction = EdgeToMachine.VtN
-- lato di lavoro e inversioni
if Chainsawing.Tool.IsCCW then
Chainsawing.Workside = MCH_MILL_WS.RIGHT
@@ -5160,19 +5191,19 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc)
end
Chainsawing.ToolInvert = false
-- profondità e offset longitudinale
if Chainsawing.Tool.MaxMat > Proc.Pocket.Depth - 10 * GEO.EPS_SMALL then
Chainsawing.Depth = Proc.Pocket.Depth
if Chainsawing.Tool.MaxMat > EdgeToMachine.Elevation - 10 * GEO.EPS_SMALL then
Chainsawing.Depth = EdgeToMachine.Elevation
Chainsawing.LongitudinalOffset = 0
else
Chainsawing.Depth = Chainsawing.Tool.MaxMat
Chainsawing.LongitudinalOffset = Proc.Pocket.Depth - Chainsawing.Depth
Chainsawing.Message = 'Feature '.. Proc.FeatureId .. ' : chainsaw elevation (' .. EgtNumToString( Proc.Pocket.Depth, 1) .. ') bigger than max tool depth (' .. EgtNumToString( Chainsawing.Depth, 1) .. ')'
Chainsawing.LongitudinalOffset = EdgeToMachine.Elevation - Chainsawing.Depth
Chainsawing.Message = 'Feature '.. Proc.FeatureId .. ' : chainsaw elevation (' .. EgtNumToString( EdgeToMachine.Elevation, 1) .. ') bigger than max tool depth (' .. EgtNumToString( Chainsawing.Depth, 1) .. ')'
EgtOutLog( Chainsawing.Message)
end
-- offset radiale
Chainsawing.RadialOffset = 0
-- distanza di sicurezza
Chainsawing.StartSafetyLength = Proc.Pocket.Depth
Chainsawing.StartSafetyLength = EdgeToMachine.Elevation
-- overlap
Chainsawing.Overlap = 0
-- faceuse
@@ -5193,7 +5224,7 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc)
-- eventuale avviso di danneggiamento pezzo successivo
local dOffsideLength = max( Chainsawing.LeadIn.StartAddLength, Chainsawing.LeadOut.EndAddLength) + Chainsawing.Tool.Width / 2 + 10 * GEO.EPS_SMALL
if ( not Proc.Tail or Proc.AdvTail) and Proc.AffectedFaces.Left and ( Proc.Pocket.DistanceToNextPart < dOffsideLength) then
if ( not Proc.Tail or Proc.AdvTail) and Proc.AffectedFaces.Left and ( Proc.DistanceToNextPart < dOffsideLength) then
local sDamageNextPieceMessage = 'Feature '.. Proc.FeatureId .. ' : chainsaw can damage next piece.'
if #Chainsawing.Message > 0 then
Chainsawing.Message = Chainsawing.Message .. '\n' .. sDamageNextPieceMessage
@@ -5207,21 +5238,21 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc)
end
function SawPlusChain.Make( Proc, nRawId, nPhase, bOnlySaw)
Proc.Pocket = {}
Proc.Pocket.ApplyOnlySawblade = bOnlySaw
Proc.Pocket.Strategy = 'SawPlusChain'
function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
Proc.Strategy = {}
Proc.Strategy.ApplyOnlySawblade = bOnlySaw
Proc.Strategy.Name = 'SawPlusChain'
local b3Raw = EgtGetRawPartBBox( nRawId)
-- TODO per implementare la strategia con lapjoint lunghe bisogna prima riconoscere le topologie che arrivano
if Proc.IsSplittedLapJoint then
local sErr = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. Proc.Pocket.Strategy .. ' not implemented for long lapjoint'
local sErr = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. Proc.Strategy.Name .. ' not implemented for long lapjoint'
EgtOutLog( sErr)
return false, sErr
end
if not SawPlusChain.IsTopologyOk( Proc) then
local sErr = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. Proc.Pocket.Strategy .. ' not implemented'
local sErr = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. Proc.Strategy.Name .. ' not implemented'
EgtOutLog( sErr)
return false, sErr
end
@@ -5229,23 +5260,21 @@ function SawPlusChain.Make( Proc, nRawId, nPhase, bOnlySaw)
-- se tasca su faccia sotto la strategia non è applicabile (la sega a catena in generale non può lavorare da sotto)
-- TODO se OnlySaw questo test è da rimuovere ma bisogna considerare anche la lama da sotto
if Proc.AffectedFaces.Bottom and ( Proc.Fct > 3 or not Proc.AffectedFaces.Top) then
local sErr = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. Proc.Pocket.Strategy .. ' not applicable - pocket on bottom face'
local sErr = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. Proc.Strategy.Name .. ' not applicable - pocket on bottom face'
EgtOutLog( sErr)
return false, sErr
end
-- caratteristiche della tasca
Proc.Pocket.BottomFace = SawPlusChain.GetBottomFace( Proc)
Proc.Pocket.FaceToMachine = SawPlusChain.GetFaceToMachine( Proc)
Proc.Pocket.SideFaces = SawPlusChain.GetSideFaces( Proc)
Proc.Pocket.Width = Proc.Pocket.BottomFace.Width
Proc.Pocket.Height = Proc.Pocket.BottomFace.Height
Proc.Pocket.Depth = Proc.Pocket.BottomFace.Elevation
Proc.Pocket.Direction = Proc.Pocket.BottomFace.VtN
Proc.Pocket.DistanceToNextPart = BL.GetDistanceToNextPart( nRawId, nPhase)
-- facce principali
Proc.MainFaces = {}
Proc.MainFaces.BottomFace = SawPlusChain.GetBottomFace( Proc)
Proc.MainFaces.LongFace = SawPlusChain.GetLongFace( Proc)
Proc.MainFaces.SideFaces = SawPlusChain.GetSideFaces( Proc)
-- parametri lavorazione di lama
local Cutting = SawPlusChain.Saw.CalculateMachiningParameters( Proc)
local FaceToMachine = Proc.MainFaces.LongFace
local EdgeToMachine = SawPlusChain.GetEdgeToMachine( 'Bottom', Proc, FaceToMachine)
local Cutting = SawPlusChain.Saw.CalculateMachiningParameters( Proc, FaceToMachine, EdgeToMachine)
-- applicazione lavorazione di lama con eventuali step XY
local bIsCuttingOk = false
@@ -5278,7 +5307,7 @@ function SawPlusChain.Make( Proc, nRawId, nPhase, bOnlySaw)
end
-- parametri lavorazione con sega a catena
local Chainsawing = SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc)
local Chainsawing = SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine, EdgeToMachine)
-- si lavora solo quanto non lavorato dalla lama
Chainsawing.MaxElev = Cutting.RadialOffset + BD.CUT_EXTRA
@@ -5332,11 +5361,11 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
end
-- strategia lama + eventuale sega a catena
if ( EgtGetInfo( Proc.Id, Q_SAW_PLUS_CHAIN, 'i') or 0) > 0 then --TEST
if ( EgtGetInfo( Proc.Id, Q_SAW_PLUS_CHAIN, 'i') or 0) > 0 then
local bOk
local sErr
local bOnlySaw = EgtGetInfo( Proc.Id, Q_SAW_PLUS_CHAIN, 'i') == 1
bOk, sErr = SawPlusChain.Make ( Proc, nRawId, nPhase, bOnlySaw)
bOk, sErr = SawPlusChain.Make ( bOnlySaw, Proc, nRawId)
return bOk, sErr
end