From cc3b0da9e515f303ab8707f6a407404821e739fe Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Tue, 14 May 2024 19:00:26 +0200 Subject: [PATCH] - in SawPlusChain le lavorazioni di sega a catena aggiuntive (side) si fermano in mezzeria se tasca passante - in SawPlusChain il tunnel con sega a catena viene fatto da un solo lato se possibile --- LuaLibs/ProcessLapJoint.lua | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index cb3faf8..482050e 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -4848,10 +4848,13 @@ function SawPlusChain.GetLongFaceEdges( Proc, Face) else if CurrentEdge.AdjacentFaceId == Proc.MainFaces.BottomFace.Id then Edges.BottomEdge = CurrentEdge + Edges.BottomEdge.Type = 'Bottom' elseif vEdges[nNextEdgeIndex].Adj == Proc.MainFaces.BottomFace.Id then Edges.SideEdges.StartEdge = CurrentEdge + Edges.SideEdges.StartEdge.Type = 'Side' elseif vEdges[nPreviousEdgeIndex].Adj == Proc.MainFaces.BottomFace.Id then Edges.SideEdges.EndEdge = CurrentEdge + Edges.SideEdges.EndEdge.Type = 'Side' else table.insert( Edges.OppositeEdges, CurrentEdge) end @@ -5242,32 +5245,40 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine Mortising.CanApply = true Mortising.Message = '' Mortising.ProcId = Proc.Id + local bNeedToMachineOtherSide = false local dTestCornerRadius = 43 + -- OneSide | OneSideAndExtend | BothSides | BothSidesAndExtend local sMortisingType local dPocketHeight = 0 if Proc.Topology == 'Tunnel' then dPocketHeight = Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Height else + -- TODO qui non va bene, sostituire con la lunghezza del lato della BottomFace corrispondente alla faccia lavorata dPocketHeight = Proc.MainFaces.BottomFace.Height end -- ricerca lavorazione if Proc.Topology == 'Tunnel' then Mortising.Name = ML.FindSawing( 'Sawing', abs( EdgeToMachine.Elevation) + dTestCornerRadius + BD.CUT_EXTRA_MIN) - sMortisingType = "OneSideAndExtend" + sMortisingType = 'OneSideAndExtend' if not Mortising.Name then Mortising.Name = ML.FindSawing( 'Sawing', abs( EdgeToMachine.Elevation) / 2 + dTestCornerRadius + BD.CUT_EXTRA_MIN) - sMortisingType = "BothSidesAndExtend" + sMortisingType = 'BothSidesAndExtend' end + elseif EdgeToMachine.Type == 'Side' and #( Proc.MainFaces.SideFaces) == 0 then + Mortising.Name = ML.FindSawing( 'Sawing', abs( EdgeToMachine.Elevation) / 2 + dTestCornerRadius + BD.CUT_EXTRA_MIN) + sMortisingType = 'BothSidesAndExtend' else Mortising.Name = ML.FindSawing( 'Sawing', abs( EdgeToMachine.Elevation)) - sMortisingType = "OneSide" + sMortisingType = 'OneSide' end if not Mortising.Name then Mortising.Name = ML.FindSawing( 'Sawing', nil, nil, 'Longest') - if Proc.Topology == 'Tunnel' then - sMortisingType = "BothSides" + if sMortisingType == 'BothSidesAndExtend' then + sMortisingType = 'BothSides' + elseif sMortisingType == 'OneSideAndExtend' then + sMortisingType = 'OneSide' end end if not Mortising.Name then @@ -5311,14 +5322,16 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine Mortising.ToolInvert = true end -- profondità e offset longitudinale - if sMortisingType == "OneSide" then + if sMortisingType == 'OneSide' then Mortising.Depth = abs( EdgeToMachine.Elevation) elseif sMortisingType == 'OneSideAndExtend' then Mortising.Depth = abs( EdgeToMachine.Elevation) + Mortising.Tool.CornerRadius + BD.CUT_EXTRA_MIN elseif sMortisingType == 'BothSides' then Mortising.Depth = abs( EdgeToMachine.Elevation) / 2 + bNeedToMachineOtherSide = true elseif sMortisingType == 'BothSidesAndExtend' then Mortising.Depth = abs( EdgeToMachine.Elevation) / 2 + Mortising.Tool.CornerRadius + BD.CUT_EXTRA_MIN + bNeedToMachineOtherSide = true end if Mortising.Tool.MaxMat > Mortising.Depth - 10 * GEO.EPS_SMALL then if EdgeToMachine.Elevation > -10 * GEO.EPS_SMALL then @@ -5379,7 +5392,7 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine EgtOutLog( sDamageNextPieceMessage) end - return Mortising + return Mortising, bNeedToMachineOtherSide end @@ -5452,7 +5465,6 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId) return bIsCuttingOk, Cutting.Message end local dBottomDepthToMachine = Cutting.RadialOffset - -- lato opposto del tunnel if Proc.Topology == 'Tunnel' then Cutting = SawPlusChain.Saw.CalculateMachiningParameters( Proc, Proc.MainFaces.LongFace, Proc.MainFaces.LongFace.Edges.OppositeEdges[2]) @@ -5501,8 +5513,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId) -- sega a catena -- parametri lavorazione con sega a catena - fondo della tasca o tunnel local Mortising = {} + local bNeedToMachineOtherSide = false if Proc.Topology == 'Tunnel' then - Mortising = SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, Proc.MainFaces.LongFace, Proc.MainFaces.LongFace.Edges.OppositeEdges[1]) + Mortising, bNeedToMachineOtherSide = SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, Proc.MainFaces.LongFace, Proc.MainFaces.LongFace.Edges.OppositeEdges[1]) else Mortising = SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, Proc.MainFaces.LongFace, Proc.MainFaces.LongFace.Edges.BottomEdge) -- si lavora solo quanto non lavorato dalla lama @@ -5512,9 +5525,8 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId) if Mortising.CanApply then bIsMortisingOk, Mortising.Message = SawPlusChain.Chainsaw.ApplyAllSteps( Mortising, b3Raw) end - -- lato opposto del tunnel - if Proc.Topology == 'Tunnel' then + if Proc.Topology == 'Tunnel' and bNeedToMachineOtherSide then Mortising = SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, Proc.MainFaces.LongFace, Proc.MainFaces.LongFace.Edges.OppositeEdges[2]) bIsMortisingOk = false if Mortising.CanApply then