From 77c7e42e4266e905110b2c376000572947f26917 Mon Sep 17 00:00:00 2001 From: DarioS Date: Mon, 12 Dec 2022 15:33:02 +0100 Subject: [PATCH] =?UTF-8?q?DataBeam=20:=20-=20in=20Tenon=20corretta=20scel?= =?UTF-8?q?ta=20bordo=20vicino=20per=20attacco=20-=20in=20LapJoint=20se=20?= =?UTF-8?q?non=20definito=20BD.MIN=5FLEN=5FLAMELLO=20si=20usa=201000,=20in?= =?UTF-8?q?=20MachineByMill=20migliorata=20ricerca=20utensile=20e=20corret?= =?UTF-8?q?ta=20gestione=20inversione=20in=20funzione=20del=20lato=20di=20?= =?UTF-8?q?lavoro=20-=20in=20Mortise=20migliorato=20controllo=20necessit?= =?UTF-8?q?=C3=A0=20CleanCorners.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/ProcessLapJoint.lua | 18 +++++++++++------- LuaLibs/ProcessMortise.lua | 32 ++++++++++++++++++-------------- LuaLibs/ProcessTenon.lua | 2 +- 3 files changed, 30 insertions(+), 22 deletions(-) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 50d0c03..9c54b49 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -1,4 +1,4 @@ --- ProcessLapJoint.lua by Egaltech s.r.l. 2022/09/27 +-- ProcessLapJoint.lua by Egaltech s.r.l. 2022/12/12 -- Gestione calcolo mezzo-legno per Travi -- 2019/10/08 Agg. gestione OpenPocket. -- 2021/01/24 Con sega a catena ora sempre impostato asse A. @@ -56,6 +56,7 @@ -- Migliorata gestione AntiSplint (Mill e Saw) -- 2022/09/27 Aggiunta gestione SCC per svuotature con TURN (solo dopo applicazione lavorazione). -- 2022/10/20 In MakeByChainOrSaw modificato check per trovare la faccia adiacente sul lato più lungo. +-- 2022/12/12 Default 1000 per BD.MIN_LEN_LAMELLO. In MachineByMill migliorata ricerca utensile e gestione inversione in funzione del lato di lavoro. -- Tabella per definizione modulo local ProcessLapJoint = {} @@ -3246,8 +3247,10 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas local sMilling if nUseRoughTool > 0 then sMilling = ML.FindMilling( 'Long2Cut', nil, sTuuidPk) + if not sMilling then sMilling = ML.FindMilling( 'Long2Cut') end else sMilling = ML.FindMilling( 'LongSmallCut', nil, sTuuidPk) + if not sMilling then sMilling = ML.FindMilling( 'LongSmallCut') end end if not sMilling then local sErr = 'Error : Long2Cut & LongSmallCut not found in library' @@ -3276,8 +3279,9 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas EgtSetMachiningGeometry( {{ Proc.Id, (nSideFace)}}) -- imposto uso faccia EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse) - -- setto inversione del percorso - EgtSetMachiningParam( MCH_MP.INVERT, true) + -- sistemazione inversione del percorso + local nWrkSide = EgtGetMachiningParam( MCH_MP.WORKSIDE) + EgtSetMachiningParam( MCH_MP.INVERT, ( nWrkSide ~= MCH_MILL_WS.RIGHT)) -- setto a 0 eventuali offset EgtSetMachiningParam( MCH_MP.OFFSR, 0) -- calcolo elevazione per allungamenti attacchi con fianchi chiusi @@ -4936,7 +4940,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa local nFaces = EgtSurfTmFacetCount( nTestId) while not bExit and nFaces >= 3 do local bDeleteFace - nInt = 0 + local nInt = 0 while not bDeleteFace and nInt < nFaces do nInt = nInt + 1 local b3Facet = EgtSurfTmGetFacetBBoxGlob( nTestId, nInt-1, GDB_BB.STANDARD) @@ -4963,9 +4967,9 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa -- cancello la copia del percorso EgtErase( nTestId) - if bNewIsU and ( not BD.MIN_LEN_LAMELLO or - ( Proc.TotBox and Proc.TotBox:getDimX() > BD.MIN_LEN_LAMELLO) or - ( not Proc.TotBox and Proc.Box:getDimX() > BD.MIN_LEN_LAMELLO)) then + if bNewIsU and + (( Proc.TotBox and Proc.TotBox:getDimX() > ( BD.MIN_LEN_LAMELLO or 1000)) or + ( not Proc.TotBox and Proc.Box:getDimX() > ( BD.MIN_LEN_LAMELLO or 1000))) then -- recupero la lavorazione local bDownHead = BD.DOWN_HEAD and vtN:getZ() < BD.NZ_MINA sMillingOnSide = ML.FindMilling( 'SideMillAsBlade_H2', nil, nil, nil, nil, not bDownHead, bDownHead) diff --git a/LuaLibs/ProcessMortise.lua b/LuaLibs/ProcessMortise.lua index 1b8a87d..d321317 100644 --- a/LuaLibs/ProcessMortise.lua +++ b/LuaLibs/ProcessMortise.lua @@ -1,4 +1,4 @@ --- ProcessMortise.lua by Egaltech s.r.l. 2021/12/01 +-- ProcessMortise.lua by Egaltech s.r.l. 2022/12/12 -- Gestione calcolo mortase per Travi -- 2021/07/20 Aggiunta gestione rinvio angolare su FAST. -- 2021/12/01 Se frontale aggiungo taglio con Grp e Proc di vero taglio (per aggiornare ingombro di testa /coda). @@ -6,6 +6,7 @@ -- 2022/07/29 Nella pulitura angoli aggiunto il check dimensioni tasca vs utensile. Corretta direzione utensile per mortasa frontale. -- 2022/09/27 Migliorata la scelta utensile. Se c'è almeno una lavorazione 'mortise' si cerca di usare quelle, riducendo l'elevazione se necessario. -- Se non c'è nemmeno una lavorazione 'mortise' si passa alle pocket. +-- 2022/12/12 Migliorato controllo necessità CleanCorners. -- Tabella per definizione modulo local ProcessMortise = {} @@ -141,20 +142,21 @@ end --------------------------------------------------------------------- -- Pulizia angoli nel caso sia settato il parametro P04=1 local function CleanCorners( Proc, dMorH, vtN, bDoubleDir, AuxId) - -- verifico se è attiva la pulizia e se l'orientamento della feature è adeguato - local bCleanCorners = ( EgtGetInfo( Proc.Id, 'P04', 'i') == 1 and - ( AreSameOrOppositeVectorApprox( vtN, X_AX()) or - AreSameOrOppositeVectorApprox( vtN, Y_AX()) or - AreSameOrOppositeVectorApprox( vtN, Z_AX()))) + -- verifico se l'orientamento della feature è adeguato + local bCleanCorners = ( AreSameOrOppositeVectorApprox( vtN, X_AX()) or + AreSameOrOppositeVectorApprox( vtN, Y_AX()) or + AreSameOrOppositeVectorApprox( vtN, Z_AX())) if not bCleanCorners then - EgtOutLog( 'Warning: mortising not aligned with XYZ axes, corner cleaning skipped') - return + local sWarn = 'Warning: mortising not aligned with XYZ axes, corner cleaning skipped' + EgtOutLog( sWarn) + return true, sWarn end -- cerco la lavorazione adatta local sMortisingCleanCorners = ML.FindSawing( 'Mortising') if not sMortisingCleanCorners then - EgtOutLog( 'Warning: mortising tool not found, corner cleaning skipped') - return + local sWarn = 'Warning: mortising tool not found, corner cleaning skipped' + EgtOutLog( sWarn) + return true, sWarn end -- recupero i dati dell'utensile local dSawWidth = 50 @@ -565,10 +567,12 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) end end -- verifico se necessaria la pulizia degli angoli ( tenone ad angoli non raggiati) e applico nel caso - local _, sWarn2 = CleanCorners( Proc, dMorH, vtN, bOpenBtm and not bForceOneSide, AuxId) - if sWarn2 then - if not sWarn then sWarn = '' end - sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2) + if ( EgtGetInfo( Proc.Id, 'P04', 'i') == 1) then + local _, sWarn2 = CleanCorners( Proc, dMorH, vtN, bOpenBtm and not bForceOneSide, AuxId) + if sWarn2 then + if not sWarn then sWarn = '' end + sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2) + end end return true, sWarn diff --git a/LuaLibs/ProcessTenon.lua b/LuaLibs/ProcessTenon.lua index 7aa3754..fdf59a4 100644 --- a/LuaLibs/ProcessTenon.lua +++ b/LuaLibs/ProcessTenon.lua @@ -226,7 +226,7 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) -- porto inizio curva il più possibile sul bordo in alto o in basso local dMaxDist = OVERLAP_COEFF * dMillDiam * MAX_PASS local bMyShortPart = ( bShortPart and vtN:getX() < 0 and abs( vtN:getX()) < 0.999 and abs( vtN:getY()) < 0.259) - BL.PutStartNearestToEdge( AuxId, b3Solid, dMaxDist, ( bH2 and bMillDown) ~= bMyShortPart) + BL.PutStartNearestToEdge( AuxId, b3Solid, dMaxDist, EgtIf( bH2 and bMillDown, not bMyShortPart, bMyShortPart)) -- se elevazione superiore a massimo affondamento della fresa, riduco opportunamente local sWarn local dDepth = 0