diff --git a/LuaLibs/MachiningLib.lua b/LuaLibs/MachiningLib.lua index 1547b03..3fa8063 100644 --- a/LuaLibs/MachiningLib.lua +++ b/LuaLibs/MachiningLib.lua @@ -6,6 +6,7 @@ -- 2022/11/25 Per FindMilling implementata la possibilità di escludere la testa H3 dalla ricerca utensile. -- 2022/12/28 Per FindMilling e FindDrilling possibilità di escludere la testa H2 dalla ricerca utensile. -- 2023/01/31 Per FindPocketing implementata la possibilità di escludere le teste H2 o H3 dalla ricerca utensile. +-- 2023/07/28 Aggiunta gestione del tipo di foratura "Drill_AT". -- Tabella per definizione modulo local MachiningLib = {} @@ -176,7 +177,7 @@ end --------------------------------------------------------------------- function VerifyTool( MachiningType, sType, Params, bH2) if MachiningType == MCH_MY.DRILLING then - if EgtStartsWith( sType, 'Drill') or EgtStartsWith( sType, 'AngleDrill') then + if EgtStartsWith( sType, 'Drill') or EgtStartsWith( sType, 'Drill_AT') or EgtStartsWith( sType, 'AngleDrill') then return VerifyDrill( Params.Diam, Params.Depth, bH2) elseif EgtStartsWith( sType, 'Pocket') then return VerifyDrillPocket( Params.Diam, Params.Depth, bH2) @@ -213,7 +214,7 @@ end function ReturnParams( MachiningType, MachiningName, sType, ToolParams) if MachiningType == MCH_MY.DRILLING then local _, sOrigType = EgtEndsWith( sType, '_H2') - return MachiningName, sType, EgtIf( sOrigType == 'Drill' or sOrigType == 'AngleDrill' , ToolParams.TMaxMat, ToolParams.TMaxDepth), ToolParams.MaxToolLength, ToolParams.ToolDiam, ToolParams.DiamTh, ToolParams.FreeLen + return MachiningName, sType, EgtIf( sOrigType == 'Drill' or sOrigType == 'Drill_AT' or sOrigType == 'AngleDrill' , ToolParams.TMaxMat, ToolParams.TMaxDepth), ToolParams.MaxToolLength, ToolParams.ToolDiam, ToolParams.DiamTh, ToolParams.FreeLen elseif MachiningType == MCH_MY.SAWING then return MachiningName, ToolParams.H2 elseif MachiningType == MCH_MY.MILLING then @@ -379,9 +380,9 @@ function MachiningLib.FindCutting( sType, bTopHead, bDownHead) end --------------------------------------------------------------------- -function MachiningLib.FindDrilling( dDiam, dDepth, bTopHead, bDownHead, bExcludeH2) - local MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5 = FindMachining( MCH_MY.DRILLING, 'Drill', { Diam = dDiam, Depth = dDepth}, bTopHead, bDownHead, bExcludeH2) - if not MachiningName or MachiningName == '' then +function MachiningLib.FindDrilling( dDiam, dDepth, bTopHead, bDownHead, bExcludeH2, bAngleTransmission) + local MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5 = FindMachining( MCH_MY.DRILLING, EgtIf( bAngleTransmission, 'Drill_AT', 'Drill'), { Diam = dDiam, Depth = dDepth}, bTopHead, bDownHead, bExcludeH2) + if ( not MachiningName or MachiningName == '') and not bAngleTransmission then MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5 = FindMachining( MCH_MY.DRILLING, 'Pocket', { Diam = dDiam, Depth = dDepth}, bTopHead, bDownHead) end if MachiningName and MachiningName ~= '' then diff --git a/LuaLibs/ProcessDrill.lua b/LuaLibs/ProcessDrill.lua index 61f5964..2618a3d 100644 --- a/LuaLibs/ProcessDrill.lua +++ b/LuaLibs/ProcessDrill.lua @@ -17,6 +17,7 @@ -- 2022/11/23 Aggiunta la gestione dei fori con angolo < 30 gradi, per i quali si usa la testa della macchina per accorciare l'utile di lavoro. -- 2022/12/28 Implementata gestione forature in doppio -- 2023/05/11 Se lavorazione in doppio e precedente no oppure di tipo diverso, forzo risalita a Zmax. +-- 2023/07/28 Aggiunta gestione rinvio 90deg solo per forature da sotto esattamente verticali. -- Tabella per definizione modulo local ProcessDrill = {} @@ -169,7 +170,12 @@ function ProcessDrill.Classify( Proc, b3Raw) -- verifico se il foro è sotto e quindi va spostato o sopra o sul fianco if (( vtExtr:getZ() < BD.DRILL_VZ_MIN or bFaceDown) and ( not bOpen or Proc.Flg ~= 1)) then if not bOpen then - return true, true, false + -- se da sotto e presente rinvio angolare verifico se c'è opportuna lavorazione + if BD.ANG_TRASM and ML.FindDrilling( dDiam, nil, nil, nil, nil, true) and AreOppositeVectorApprox( vtExtr, Z_AX()) then + return true, false, false + else + return true, true, false + end else return true, not ( BD.ROT90 or BD.DOWN_HEAD or BD.TURN), ( BD.ROT90 or BD.DOWN_HEAD or BD.TURN) end @@ -242,8 +248,10 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) local bOpen = ( Proc.Fcs ~= 0 and Proc.Fce ~= 0) -- verifico possibilità di foratura da sotto local bDownDrill = ( BD.TURN or ( BD.DOWN_HEAD and ML.FindDrilling( dDiam, nil, false, true))) + -- se presente rinvio angolare + local bDrillAngTrasm = ( BD.ANG_TRASM and AreOppositeVectorApprox( vtExtr, Z_AX())) -- verifico che il foro non sia fattibile solo da sotto - local bToInvert = ( vtExtr:getZ() < BD.DRILL_VZ_MIN and not bDownDrill) + local bToInvert = ( vtExtr:getZ() < BD.DRILL_VZ_MIN and not bDownDrill) and not bDrillAngTrasm if bToInvert and ( not bOpen or Proc.Flg ~= 1) then local sErr = 'Error : drilling from bottom impossible' EgtOutLog( sErr) @@ -283,9 +291,9 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) end -- primo gruppo di controlli con lunghezza utensile pari a metà foro se passante -- recupero la lavorazione - local sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth, bDrillUp, bDrillDown, bExcludeH2) + local sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth, bDrillUp, bDrillDown, bExcludeH2, bDrillAngTrasm) if not sDrilling and dCheckDepth then - sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, 0, bDrillUp, bDrillDown, bExcludeH2) + sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, 0, bDrillUp, bDrillDown, bExcludeH2, bDrillAngTrasm) if sDrilling then dCheckDepth = nil end end if not sDrilling then @@ -459,7 +467,9 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) end -- imposto posizione braccio porta testa local nSCC = MCH_SCC.NONE - if not BD.C_SIMM and not BD.TURN then + if bDrillAngTrasm then + nSCC = MCH_SCC.ADIR_NEAR + elseif not BD.C_SIMM and not BD.TURN then nSCC = MCH_SCC.ADIR_YM if AreSameVectorApprox( vtExtr, Z_AX()) then nSCC = MCH_SCC.ADIR_YM diff --git a/LuaLibs/ProcessFreeContour.lua b/LuaLibs/ProcessFreeContour.lua index 69d0089..aa65038 100644 --- a/LuaLibs/ProcessFreeContour.lua +++ b/LuaLibs/ProcessFreeContour.lua @@ -8,6 +8,7 @@ -- In MakeByMill se BeamData forza lettura codolo da Q questo viene sempre fatto indipendentemente dalle dimensioni della feature -- 2023/03/03 Corretta MakeByMark ( non definiti b3Raw e b3Aux ). -- 2023/06/21 In CalcSpecialAdd modificato l'angolo minimo da 5 a 15 deg. +-- 2023/07/28 In MakeByPocket aggiunta Q06 per specificare un eventuale offset radiale del contorno. -- Tabella per definizione modulo local ProcessFreeContour = {} @@ -27,6 +28,7 @@ local Q_DIM_STRIP = 'Q01' -- d local Q_DEPTH_CHAMFER = 'Q02' -- d local Q_OVERMAT_FOR_FINISH = 'Q03' -- d local Q_ONLY_CHAMFER = 'Q00' -- i +local Q_RADIAL_OFFSET = 'Q06' -- d, valido solo per pocket --------------------------------------------------------------------- -- Riconoscimento della feature @@ -773,6 +775,11 @@ local function MakeByPocket( Proc, nPhase, nRawId, nPartId, dOvmHead) EgtSetMachiningParam( MCH_MP.DEPTH, dDepth) -- imposto elevazione EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dMaxDepth, 1) .. ';') + -- imposto eventuale offset radiale, se impostato dall'utente + local dRadialOffset = EgtGetInfo( Proc.Id, Q_RADIAL_OFFSET, 'd') or 0 + if abs( dRadialOffset) > 10 * GEO.EPS_SMALL then + EgtSetMachiningParam( MCH_MP.OFFSR, -dRadialOffset) + end -- eseguo if not ML.ApplyMachining( true, false) then local _, sErr = EgtGetLastMachMgrError() diff --git a/UpdateLog.txt b/UpdateLog.txt index 1871614..fe1312d 100644 --- a/UpdateLog.txt +++ b/UpdateLog.txt @@ -1,5 +1,10 @@ ==== Beam Update Log ==== +Versione 2.5g2 (31/07/2023) +- Added : in FreeContour, solo se pocket, aggiunta Q06 per specificare un eventuale offset radiale del contorno [Ticket #1334] +- Added : aggiunta gestione forature verticali con rinvio angolare [Ticket #1332] +- Fixed : corretta gestione antischeggia con lama su LapJoint [Ticket #1351]. + Versione 2.5g1 (05/07/2023) - Modif : in DiceCut modificata scelta tagli ortogonali quando liberi (esteso caso di verticali ammessi) - Modif : in LapJoint estesi casi riconoscimento in coda basato su lunghezza