From 044a074b7688f062627ce30c22836c8d0eaa2e63 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Wed, 6 Aug 2025 17:26:15 +0200 Subject: [PATCH 1/7] - in LapJoint migliorie a SawPlusChain --- LuaLibs/ProcessLapJoint.lua | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 0bcd07b..26eccd0 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -5083,6 +5083,7 @@ function SawPlusChain.GetBottomFaceEdges( Proc, Face) CurrentEdge.IsOpen = vEdges[j].Open CurrentEdge.IsStartOpen = ( vEdges[nPreviousEdgeIndex].Open) CurrentEdge.IsEndOpen = ( vEdges[nNextEdgeIndex].Open) + CurrentEdge.Id = j - 1 if CurrentEdge.AdjacentFaceId == Proc.MainFaces.LongFace.Id then table.insert( Edges.LongEdges, CurrentEdge) @@ -5128,6 +5129,7 @@ function SawPlusChain.GetLongFaceEdges( Proc, Face) CurrentEdge.IsOpen = vEdges[j].Open CurrentEdge.IsStartOpen = ( vEdges[nPreviousEdgeIndex].Open) CurrentEdge.IsEndOpen = ( vEdges[nNextEdgeIndex].Open) + CurrentEdge.Id = j - 1 if Proc.Topology == 'Tunnel' then if CurrentEdge.AdjacentFaceId > -1 then @@ -5277,6 +5279,9 @@ function SawPlusChain.ApplyMachining( Machining, b3Raw) if Machining.MaxElev then sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', Machining.MaxElev) end + if Machining.nEdgeFaceUse then + sUserNotes = EgtSetValInNotes( sUserNotes, 'EdgesFaceUse', EgtNumToString( Machining.nEdgeFaceUse)) + end EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes) local bIsApplyOk = ML.ApplyMachining( true, false) @@ -5455,6 +5460,7 @@ function SawPlusChain.Saw.CalculateMachiningParameters( Proc, FaceToMachine, Edg else Cutting.Faceuse = BL.GetNearestOrthoOpposite( -EdgeToMachine.ToolDirection) end + Cutting.nEdgeFaceUse = EdgeToMachine.Id -- SCC Cutting.SCC = SawPlusChain.Saw.GetSCC( EdgeToMachine.ToolDirection) -- asse bloccato @@ -5495,6 +5501,7 @@ end function SawPlusChain.Saw.ApplyAllSteps( Cutting, b3Raw) local bIsCuttingOk = false + local sCuttingOriginalMessage = Cutting.Message or '' local sCuttingApplyMessage = '' local dOriginalRadialOffset = Cutting.RadialOffset @@ -5509,7 +5516,9 @@ function SawPlusChain.Saw.ApplyAllSteps( Cutting, b3Raw) bIsCuttingOk, sCuttingApplyMessage = SawPlusChain.ApplyMachining( Cutting, b3Raw) -- update messaggi if sCuttingApplyMessage and #sCuttingApplyMessage > 0 then - sCuttingApplyMessage = sCuttingApplyMessage .. 'Apply : ' .. sCuttingApplyMessage .. '\n' + sCuttingApplyMessage = sCuttingOriginalMessage .. '\n' .. sCuttingApplyMessage .. 'Apply : ' .. sCuttingApplyMessage .. '\n' + else + sCuttingApplyMessage = sCuttingOriginalMessage end end @@ -5766,7 +5775,7 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId) return bIsCuttingOk, Cutting.Message end end - else + elseif Proc.IsParallel then -- se la lama non è arrivata sul fondo e c'è almeno un lato aperto va lavorato if Cutting.CanApply and Cutting.RadialOffset > 10 * GEO.EPS_SMALL then -- eventuale lavorazione di lama - lato della tasca da cui inizia la lavorazione @@ -5826,7 +5835,7 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId) return bIsMortisingOk, Mortising.Message end end - else + elseif Proc.IsParallel then -- se la sega a catena non è arrivata sul fondo e c'è almeno un lato aperto va lavorato if Mortising.LongitudinalOffset > 10 * GEO.EPS_SMALL then -- eventuale lavorazione di sega a catena - lato della tasca da cui inizia la lavorazione From 7248c44406fcf46b9446a21be203295450df48bb Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Thu, 7 Aug 2025 17:37:37 +0200 Subject: [PATCH 2/7] - migliorie a ottimizzazione teste --- LuaLibs/MachiningLib.lua | 4 ++-- LuaLibs/ProcessLapJoint.lua | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/LuaLibs/MachiningLib.lua b/LuaLibs/MachiningLib.lua index 167e9cb..8e02439 100644 --- a/LuaLibs/MachiningLib.lua +++ b/LuaLibs/MachiningLib.lua @@ -80,7 +80,7 @@ end -- setta ultimi testa e utensile utilizzati se compatibili con ottimizzazione testa local function ConfirmNextMachining() -- utensile corrente - local sToolUuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) + local sToolUuid = EgtGetMachiningParam( MCH_MP.TUUID) local sToolName = EgtTdbGetToolFromUUID( sToolUuid or '') EgtTdbSetCurrTool( sToolName or '') -- testa dell'utensile corrente @@ -331,7 +331,7 @@ end --------------------------------------------------------------------- local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sSortingCriterion) - local bOptimizeHeads = BEAM and BEAM.BW and ( not sSortingCriterion or sSortingCriterion == '') + local bOptimizeHeads = ( not sSortingCriterion or sSortingCriterion == '') if bTopHead == nil and bDownHead == nil then bTopHead = true bDownHead = false diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 26eccd0..8408409 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -6883,6 +6883,12 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa nil, nil, nil, b3Solid) if not bOk then return false, sWarn2 end end + -- dopo aver applicato gli antischeggia ricerco la svuotatura perchè l'ottimizzazione teste deve sapere quale è la lavorazione precedente + _, sPocketing, dMyTMaxDepth, dMyTDiam = VerifyPocket( Proc, dDiam, dFacElev + dCollSic, dMaxTotLen, sMchFind, bMillUp, bMillDown) + if not sPocketing and bMillUp then + _, sPocketing, dMyTMaxDepth, dMyTDiam = VerifyPocket( Proc, dDiam, dFacElev + dCollSic, dMaxTotLen, sMchFind) + bMillDown = false + end -- se smusso non esclusivo if nChamfer < 2 then -- eseguo la svuotatura della faccia principale, mi restituisce id utensile, il diametro utensile per il foro opzionale From 36f4014969068ad26941fd9a8a19b42183982fa3 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Fri, 8 Aug 2025 09:52:14 +0200 Subject: [PATCH 3/7] - in ProcessDrill in foratura in doppio si riduce lo step solo se foro passante e almeno 2 step --- LuaLibs/ProcessDrill.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LuaLibs/ProcessDrill.lua b/LuaLibs/ProcessDrill.lua index 7856b25..509bd77 100644 --- a/LuaLibs/ProcessDrill.lua +++ b/LuaLibs/ProcessDrill.lua @@ -642,8 +642,8 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) local dStep = EgtGetMachiningParam( MCH_MP.STEP) local nNumStep = ceil( dDepth/dStep) local dRealStep = dDepth / nNumStep - -- Se nel penultimo step le punte si trovano più vicine del minimo ( MinDistX1X2 + Puntina centraggio H1 + puntina centraggio H2) ricalcolo facendo uno step in meno - if ( ( dLen / 2) - ( dRealStep * (nNumStep - 1))) * 2 < ( 40 + 10 + 10) then + -- Se foro passante e nel penultimo step le punte si trovano più vicine del minimo ( MinDistX1X2 + Puntina centraggio H1 + puntina centraggio H2) ricalcolo facendo uno step in meno + if bOpen and ( nNumStep > 1) and ( ( dLen / 2) - ( dRealStep * (nNumStep - 1))) * 2 < ( 40 + 10 + 10) then dRealStep = ceil( dDepth / (nNumStep - 1)) EgtSetMachiningParam( MCH_MP.STEP, dRealStep) sMyWarn ='Warning in drill-double : step changed to ' .. tostring(dRealStep) .. 'mm' From 86e2324856c3ef0f030fa5b4d8a4a051126aa1ee Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Fri, 8 Aug 2025 11:39:26 +0200 Subject: [PATCH 4/7] - in Lapjoint lunghe si suddivide usando sempre ENDLEN per evitare problemi di pinzaggio. In futuro (o versione nuova) trattare come LongCut e usare EndLen agli estremi e MaxLen in mezzo --- LuaLibs/ProcessLapJoint.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 8408409..1bfbc36 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -7087,7 +7087,7 @@ local function MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead) -- la divido in parti lungo X local vAddId = {} local bAllWithEndCap = bAddEndCapLeftSide or bAddEndCapRightSide - local nPart = max( ceil( Proc.Box:getDimX() / BD.LONGCUT_MAXLEN + 10 * GEO.EPS_SMALL), 2) + local nPart = max( ceil( Proc.Box:getDimX() / BD.LONGCUT_ENDLEN + 10 * GEO.EPS_SMALL), 2) local dPartLen = Proc.Box:getDimX() / nPart local Xmin = Proc.Box:getMin():getX() -- trimesh per la creazione degli EndCap From 54c835f71726a33e6ac56c30beef877f188d869d Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Fri, 8 Aug 2025 13:04:58 +0200 Subject: [PATCH 5/7] - in LapJoint migliorata spezzatura per feature lunghe rispetto al pezzo --- LuaLibs/ProcessLapJoint.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 1bfbc36..dcdaa3e 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -7087,7 +7087,7 @@ local function MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead) -- la divido in parti lungo X local vAddId = {} local bAllWithEndCap = bAddEndCapLeftSide or bAddEndCapRightSide - local nPart = max( ceil( Proc.Box:getDimX() / BD.LONGCUT_ENDLEN + 10 * GEO.EPS_SMALL), 2) + local nPart = max( ceil( Proc.Box:getDimX() / BD.LONGCUT_MAXLEN + 10 * GEO.EPS_SMALL), 2) local dPartLen = Proc.Box:getDimX() / nPart local Xmin = Proc.Box:getMin():getX() -- trimesh per la creazione degli EndCap @@ -7477,7 +7477,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) end -- se lunghezza richiede spezzatura if ( Proc.Box:getDimX() > BD.LONGCUT_MAXLEN) or - ( Proc.Box:getDimX() > 0.7 * b3Solid:getDimX() and Proc.Box:getDimX() > BD.LONGCUT_ENDLEN) or + ( Proc.Box:getDimX() > 0.7 * b3Solid:getDimX() and ( b3Solid:getDimX() > ( BD.LEN_VERY_SHORT_PART or BD.LEN_SHORT_PART))) or ( ( nForceUseBladeOnNotContinueFace and nForceUseBladeOnNotContinueFace > 0) and ( Proc.Box:getDimX() > ( BD.LEN_SHORT_PART or 1000))) then -- una faccia if Proc.Fct == 1 then From db5334217bf8db4c68bb45e51b9b5630329912d8 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Fri, 8 Aug 2025 17:15:08 +0200 Subject: [PATCH 6/7] =?UTF-8?q?-=20in=20StepJointNotch=20se=203=20facce=20?= =?UTF-8?q?si=20chiama=20LapJoint=20-=20in=20LapJoint=20->=20MachineByMill?= =?UTF-8?q?,=20in=20lavorazione=20faccia=20inclinata,=20se=20utensile=20tr?= =?UTF-8?q?oppo=20pi=C3=B9=20grande=20dell'originale=20si=20salta=20la=20l?= =?UTF-8?q?avorazione?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/ProcessLapJoint.lua | 11 ++++++++++- LuaLibs/ProcessStepJointNotch.lua | 6 +++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index dcdaa3e..bfcf4e4 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -3721,7 +3721,7 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas EgtOutLog( sErr) return false, sErr else - sWarn = 'Warning : lapjoint chamfer angle machined with different tool' + sWarn = 'Warning : lapjoint angled face machined with different tool' end end -- recupero i dati dell'utensile @@ -3732,6 +3732,15 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dTDiam end end + -- se utensile troppo più grande dell'originale salto la lavorazione + if sTuuidPk and EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuidPk) or '') then + local dTDiamOriginalTool = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or 0 + if dTDiam > 2 * dTDiamOriginalTool then + sWarn = 'Warning : lapjoint angled face skipped (no compatible tool)' + EgtOutLog( sWarn) + return true, sWarn + end + end -- Calcolo uso faccia local nFaceUse = BL.GetNearestParalOpposite( tDimAndRef[1][3]:getVersZ()) -- inserisco la lavorazione di fresatura diff --git a/LuaLibs/ProcessStepJointNotch.lua b/LuaLibs/ProcessStepJointNotch.lua index a24dec6..962058a 100644 --- a/LuaLibs/ProcessStepJointNotch.lua +++ b/LuaLibs/ProcessStepJointNotch.lua @@ -13,6 +13,7 @@ local Fbs = require( 'FacesBySaw') local DC = require( 'DiceCut') local Cut = require( 'ProcessCut') local Topology = require( 'FeatureTopology') +local LapJoint = require( 'ProcessLapJoint') EgtOutLog( ' ProcessStepJointNotch started', 1) @@ -49,7 +50,7 @@ function ProcessStepJointNotch.Classify( Proc) -- numero delle facce local nFacetCnt = EgtSurfTmFacetCount( Proc.Id) -- gestisco solo 2 o 4 facce - if nFacetCnt ~= 2 and nFacetCnt ~= 4 and nFacetCnt ~= 6 and nFacetCnt ~= 8 then + if nFacetCnt ~= 2 and nFacetCnt ~= 3 and nFacetCnt ~= 4 and nFacetCnt ~= 6 and nFacetCnt ~= 8 then return false, false end -- verifico le normali delle facce @@ -583,6 +584,9 @@ end --------------------------------------------------------------------- -- Applicazione della lavorazione function ProcessStepJointNotch.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) + if Proc.Fct == 3 then + return LapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) + end -- esecuzione eventuale smusso -- ottengo anche il flag che indica che la feature è larga come la trave local bOkc, sErrC, nDiffWidth = MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead) From 91d5b0ac84e4f314e4456429b631deb2757b972a Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Tue, 19 Aug 2025 10:20:34 +0200 Subject: [PATCH 7/7] update log e version --- UpdateLog.txt | 8 ++++++++ Version.lua | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/UpdateLog.txt b/UpdateLog.txt index c00d2c6..be8c2a6 100644 --- a/UpdateLog.txt +++ b/UpdateLog.txt @@ -1,5 +1,13 @@ ==== Beam Update Log ==== +Versione 2.7h2 (19/08/2025) +- Modif : migliorata ottimizzazione teste +- Modif : migliorate forature in doppio +- Modif : in LapJoint migliorate lavorazioni lama + sega a catena +- Modif : in LapJoint migliorata spezzatura per feature lunghe rispetto al pezzo +- Modif : in LapJoint tipo BirdsMouth migliorata lavorazione faccia inclinata +- Modif : in StepJointNotch, se 3 facce si riconduce a LapJoint + Versione 2.7h1 (05/08/2025) - Fixed : in Mortise migliorata la lavorazione in caso di feature trimmata - Modif : in LapJoint, riduzione massimo materiale lama per lavorazioni antischeggia di lama con direzione verticale diff --git a/Version.lua b/Version.lua index 98cf323..b84e0d6 100644 --- a/Version.lua +++ b/Version.lua @@ -2,5 +2,5 @@ -- Gestione della versione di Beam NAME = 'Beam' -VERSION = '2.7h1' +VERSION = '2.7h2' MIN_EXE = '2.7f2'