From 0689328082304b098c3c0429f86facc1f9fe0adc Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Wed, 10 Aug 2022 13:07:35 +0200 Subject: [PATCH 1/3] BugFix/LapJointL2FacesQ03: in L030 corretta lavorazionedi facce a L verso Y con parametro Q03=2/3 --- LuaLibs/ProcessLapJoint.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 3046ca9..f8be022 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -5147,7 +5147,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa -- 3 facce non a L ma con una faccia favorevole a Y, oppure -- 4 facce -- lancio la MakePocket ( lavorazione solo da un lato, fondo della tasca la faccia più favorevole a Y) - if bForceSideMill and (( Proc.Fct == 3 and bIsL) or ( Proc.Fct == 3 and abs( vtNFacApproxY:getY()) >= 0.707 ) or Proc.Fct == 4) then + if bForceSideMill and (( Proc.Fct == 3 and bIsL) or ( ( Proc.Fct == 3 or Proc.Fct == 2) and abs( vtNFacApproxY:getY()) >= 0.707 ) or Proc.Fct == 4) then nFacInd, vtN, ptC = nFacApproxY, vtNFacApproxY, ptCFacApproxY local tvtNx = {} tvtNx[2] = vtN From d72560241b8c17e4ed5c9f273f64e41e825fc3c9 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Thu, 11 Aug 2022 18:58:18 +0200 Subject: [PATCH 2/3] Feature/DoubleSideChainSawLapJoint: In ProcessLapJoint aggiunta lavorazione tunnel splittata con sega a catena per tutte le macchine ad esclusione della Fast --- LuaLibs/ProcessLapJoint.lua | 133 +++++++++++++++++++++--------------- 1 file changed, 78 insertions(+), 55 deletions(-) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index f8be022..b590e76 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -49,6 +49,7 @@ -- 2022/06/29 Migliorate lavorazioni con fresatura di lato per L30 se parametro Q03=2. Ora con 4 facce / 3 facce a L può entrare una fresa grande fino al doppio dell'altezza della tasca / doppio della dimensione minima. -- 2022/07/05 Modifiche per sega a catena di testa e relativa MaxElev. -- 2022/07/12 In MakeByChainOrSaw aggiunto check per feature L20 usata in modo improprio e, nel caso, si passa a una lavorazione tasca. +-- 2022/08/11 Aggiunta lavorazione tunnel splittata con sega a catena per tutte le macchine ad esclusione della Fast. -- Tabella per definizione modulo local ProcessLapJoint = {} @@ -4349,6 +4350,53 @@ local function ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw, return true, sMyWarn end +--------------------------------------------------------------------- +local function MakeTunnelByChainSaw( Proc, sSawing, nLundIdFace, vtOrtho, dWorkDepth, dMaxMat, nStep, dStep, sFaceUse) + for i = 1, nStep do + -- inserisco la lavorazione di sawing + local sName = 'Csaw_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( i) + local nMchFId = EgtAddMachining( sName, sSawing) + if not nMchFId then + local sErr = 'Error adding machining ' .. sName .. '-' .. sSawing + EgtOutLog( sErr) + return false, sErr + end + -- aggiungo geometria + EgtSetMachiningGeometry( {{ Proc.Id, nLundIdFace}}) + local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nLundIdFace, GDB_ID.ROOT) + -- imposto angolo 3° asse rot + EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetChainSawBlockedAxis( 1)) + EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, vtOrtho, 1)) + -- imposto offset radiale + local dOffs = ( i - 1) * dStep + EgtSetMachiningParam( MCH_MP.OFFSR, dOffs) + EgtSetMachiningParam( MCH_MP.FACEUSE, sFaceUse) + EgtSetMachiningParam( MCH_MP.DEPTH, dWorkDepth) + EgtSetMachiningParam( MCH_MP.STARTPOS, 50) + -- eseguo + if not ML.ApplyMachining( true, false) then + if EgtGetOutstrokeInfo() then + local _, sErr = EgtGetLastMachMgrError() + EgtSetOperationMode( nMchFId, false) + return false, sErr + end + EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetChainSawBlockedAxis( 2)) + EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, vtOrtho, 2)) + if not ML.ApplyMachining( true, false) then + local _, sErr = EgtGetLastMachMgrError() + EgtSetOperationMode( nMchFId, false) + return false, sErr + end + end + if EgtIsMachiningEmpty() then + _, sWarn = EgtGetMachMgrWarning( 0) + EgtSetOperationMode( nMchFId, false) + return false, sWarn + end + end + return true +end + --------------------------------------------------------------------- local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePart, bPrevBhSideMill, bAllWithEndCap) if not BD.MAXDIAM_POCK_CORNER then @@ -4470,63 +4518,38 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa if nStep > 1 then dStep = ( dDimMin - dSawThick) / ( nStep - 1) end - for i = 1, nStep do - -- inserisco la lavorazione di sawing - local sName = 'Csaw_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( i) - local nMchFId = EgtAddMachining( sName, sSawing) - if not nMchFId then - local sErr = 'Error adding machining ' .. sName .. '-' .. sSawing - EgtOutLog( sErr) - return false, sErr - end - -- aggiungo geometria - EgtSetMachiningGeometry( {{ Proc.Id, nLundIdFace}}) - -- imposto uso del lato faccia - -- al momento, dato che la fessura è passante da parte a parte, gestisco solo la lavorazione - -- dall'alto e di fronte (da dietro è disabilitata perchè ho extracorsa con la FAST). - -- Questa feature non è applicata su facce di testa e quindi non controllo l'entrata in X - if abs(vtOrtho:getZ()) >= 0.707 then - EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_DOWN) - else - EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_BACK) - end - local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nLundIdFace, GDB_ID.ROOT) - -- imposto angolo 3° asse rot - EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetChainSawBlockedAxis( 1)) - EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, vtOrtho, 1)) - -- imposto offset radiale - local dOffs = ( i - 1) * dStep - EgtSetMachiningParam( MCH_MP.OFFSR, dOffs) - -- se possibile aumento l'affondamento pari al raggio corner + 1 - if dMaxMat > (dDepth + dSawCornerRad + 1) then - EgtSetMachiningParam( MCH_MP.DEPTH, (dDepth + dSawCornerRad + 1)) - -- se massimo affondamento utensile inferiore fessura, setto affondamento ed emetto warning - elseif dMaxMat < dDepth then - EgtSetMachiningParam( MCH_MP.DEPTH, dMaxMat) - sWarn = 'Warning : elevation bigger than max tool depth' - EgtOutLog( sWarn) - end - -- eseguo - if not ML.ApplyMachining( true, false) then - if EgtGetOutstrokeInfo() then - local _, sErr = EgtGetLastMachMgrError() - EgtSetOperationMode( nMchFId, false) - return false, sErr - end - EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetChainSawBlockedAxis( 2)) - EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, vtOrtho, 2)) - if not ML.ApplyMachining( true, false) then - local _, sErr = EgtGetLastMachMgrError() - EgtSetOperationMode( nMchFId, false) - return false, sErr - end - end - if EgtIsMachiningEmpty() then - _, sWarn = EgtGetMachMgrWarning( 0) - EgtSetOperationMode( nMchFId, false) - return false, sWarn + local bSplit = false + local sFaceUse, sFaceUseOtherSide + -- imposto il lato di lavorazione, da sopra oppure di fronte + -- se è di fronte, non è una Fast e il tagliente non arriva splitto la lavorazione + -- Questa feature non è applicata su facce di testa e quindi non controllo l'entrata in X + if abs(vtOrtho:getZ()) >= 0.707 then + sFaceUse = MCH_MILL_FU.PARAL_DOWN + else + sFaceUse = MCH_MILL_FU.PARAL_BACK + -- per escludere la Fast controllo C_SIMM + if BD.C_SIMM and dMaxMat < dDepth then + bSplit = true + sFaceUseOtherSide = MCH_MILL_FU.PARAL_FRONT + dDepth = dDepth / 2 + BD.CUT_EXTRA end end + local dWorkDepth = dDepth + if dMaxMat > dDepth + dSawCornerRad + 1 then + dWorkDepth = dDepth + dSawCornerRad + 1 + -- se massimo affondamento utensile inferiore alla profondità da lavorare, setto la profondità di lavoro e emetto warning + elseif dMaxMat < dDepth then + dWorkDepth = dMaxMat + sWarn = 'Warning : elevation bigger than max tool depth' + EgtOutLog( sWarn) + end + local bOk, sErr = MakeTunnelByChainSaw( Proc, sSawing, nLundIdFace, vtOrtho, dWorkDepth, dMaxMat, nStep, dStep, sFaceUse) + if not bOk then return false, sErr end + -- se è da lavorare anche dall'altro lato + if bSplit then + bOk, sErr = MakeTunnelByChainSaw( Proc, sSawing, nLundIdFace, vtOrtho, dWorkDepth, dMaxMat, nStep, dStep, sFaceUseOtherSide) + if not bOk then return false, sErr end + end end end -- altrimenti non è una fessura From b197c96a34a827adeaccf70426d4fa7651e544b0 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Fri, 12 Aug 2022 09:27:06 +0200 Subject: [PATCH 3/3] Feature/DoubleSideChainSawLapJoint modificati commenti --- LuaLibs/ProcessLapJoint.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index b590e76..b9cb3ea 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -4372,6 +4372,7 @@ local function MakeTunnelByChainSaw( Proc, sSawing, nLundIdFace, vtOrtho, dWorkD EgtSetMachiningParam( MCH_MP.OFFSR, dOffs) EgtSetMachiningParam( MCH_MP.FACEUSE, sFaceUse) EgtSetMachiningParam( MCH_MP.DEPTH, dWorkDepth) + -- modifico la distanza di attacco per considerare anche tunnel inclinati EgtSetMachiningParam( MCH_MP.STARTPOS, 50) -- eseguo if not ML.ApplyMachining( true, false) then @@ -4535,6 +4536,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa end end local dWorkDepth = dDepth + -- cerco di estendere il taglio considerando la parte arrotondata della lama + 1 if dMaxMat > dDepth + dSawCornerRad + 1 then dWorkDepth = dDepth + dSawCornerRad + 1 -- se massimo affondamento utensile inferiore alla profondità da lavorare, setto la profondità di lavoro e emetto warning @@ -4543,6 +4545,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa sWarn = 'Warning : elevation bigger than max tool depth' EgtOutLog( sWarn) end + -- lavoro da un lato local bOk, sErr = MakeTunnelByChainSaw( Proc, sSawing, nLundIdFace, vtOrtho, dWorkDepth, dMaxMat, nStep, dStep, sFaceUse) if not bOk then return false, sErr end -- se è da lavorare anche dall'altro lato