From 769c73765d43a4ad0ae8ad67049967fd295b2e95 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Fri, 3 May 2024 12:21:41 +0200 Subject: [PATCH] - in lapJoint -> SawPlusChain piccole modifiche - in mortise -> AddCleanCornersMachining resa locale variabile erroneamente dichiarata globale --- LuaLibs/ProcessLapJoint.lua | 43 +++++++++++++++++++++---------------- LuaLibs/ProcessMortise.lua | 2 +- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 63367ce..979b64a 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -4715,13 +4715,13 @@ function SawPlusChain.GetSideFaces( Proc) if ( not bIsFaceToMachineTheLargest and i < #FacesAdjacentToBottom) or ( bIsFaceToMachineTheLargest 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 - SideFaces[ #SideFaces].Height = Proc.Face[FacesAdjacentToBottom[i].Id + 1].Height - SideFaces[ #SideFaces].Elevation = Proc.Face[FacesAdjacentToBottom[i].Id + 1].Elevation - SideFaces[ #SideFaces].VtN = Proc.Face[FacesAdjacentToBottom[i].Id + 1].VtN - if SideFaces[ #SideFaces].Height > SideFaces[ #SideFaces].Width then - SideFaces[ #SideFaces].Height, SideFaces[ #SideFaces].Width = SideFaces[ #SideFaces].Width, SideFaces[ #SideFaces].Height + SideFaces[#SideFaces].Id = FacesAdjacentToBottom[i].Id + SideFaces[#SideFaces].Width = Proc.Face[FacesAdjacentToBottom[i].Id + 1].Width + SideFaces[#SideFaces].Height = Proc.Face[FacesAdjacentToBottom[i].Id + 1].Height + SideFaces[#SideFaces].Elevation = Proc.Face[FacesAdjacentToBottom[i].Id + 1].Elevation + SideFaces[#SideFaces].VtN = Proc.Face[FacesAdjacentToBottom[i].Id + 1].VtN + if SideFaces[#SideFaces].Height > SideFaces[#SideFaces].Width then + SideFaces[#SideFaces].Height, SideFaces[#SideFaces].Width = SideFaces[ #SideFaces].Width, SideFaces[ #SideFaces].Height end end end @@ -4793,20 +4793,10 @@ function SawPlusChain.GetHorizontalSteps( Machining) return HorizontalSteps end - -function SawPlusChain.CalculateLeadInOut( Proc, Machining) - -- 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 +function SawPlusChain.IsStartOrEndClosed( Proc, Machining) local bIsStartClosed = false local bIsEndClosed = false local bIsMortising = ( Machining.Type == MCH_OY.MORTISING) - local dAddLengthToReduce = 0 - if bIsMortising then - dAddLengthToReduce = Machining.Tool.Diameter / 2 - else - dAddLengthToReduce = sqrt( Machining.Depth * Machining.Tool.Diameter - Machining.Depth * Machining.Depth) - end if #( Proc.Pocket.SideFaces) == 2 then bIsStartClosed = true bIsEndClosed = true @@ -4830,6 +4820,23 @@ function SawPlusChain.CalculateLeadInOut( Proc, Machining) end end + return bIsStartClosed, bIsEndClosed +end + + +function SawPlusChain.CalculateLeadInOut( Proc, Machining) + -- 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 + local bIsStartClosed, bIsEndClosed = SawPlusChain.IsStartOrEndClosed( Proc, Machining) + local bIsMortising = ( Machining.Type == MCH_OY.MORTISING) + local dAddLengthToReduce = 0 + if bIsMortising then + dAddLengthToReduce = Machining.Tool.Diameter / 2 + else + dAddLengthToReduce = sqrt( Machining.Depth * Machining.Tool.Diameter - Machining.Depth * Machining.Depth) + end + local LeadIn = {} local LeadOut = {} LeadIn.StartAddLength = 0 diff --git a/LuaLibs/ProcessMortise.lua b/LuaLibs/ProcessMortise.lua index fecdfe7..db80299 100644 --- a/LuaLibs/ProcessMortise.lua +++ b/LuaLibs/ProcessMortise.lua @@ -128,7 +128,7 @@ end local nFaceUse = BL.GetNearestParalOpposite( vtN) EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse) -- applico il parametro plunge, che setta la lavorazione per affondare solamente, senza lavorare tutto il contorno; 1: solo lato iniziale, 2: solo lato finale, 3: entrambi - sNotes = 'Plunge=3;' + local sNotes = 'Plunge=3;' EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes) -- imposto angolo 3° asse rot local vtOrtho = BL.GetVersRef( nFaceUse)