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/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' diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 0bcd07b..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 @@ -5083,6 +5092,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 +5138,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 +5288,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 +5469,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 +5510,7 @@ end function SawPlusChain.Saw.ApplyAllSteps( Cutting, b3Raw) local bIsCuttingOk = false + local sCuttingOriginalMessage = Cutting.Message or '' local sCuttingApplyMessage = '' local dOriginalRadialOffset = Cutting.RadialOffset @@ -5509,7 +5525,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 +5784,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 +5844,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 @@ -6874,6 +6892,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 @@ -7462,7 +7486,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 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) 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'