From 91dd92453668afc5d425ff122898347b00acc469 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Sat, 20 Mar 2021 18:45:28 +0000 Subject: [PATCH] DataBeam : - correzioni varie per FAST. --- LuaLibs/ProcessDrill.lua | 4 ++-- LuaLibs/ProcessLapJoint.lua | 37 +++++++++++++++++++++++-------------- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/LuaLibs/ProcessDrill.lua b/LuaLibs/ProcessDrill.lua index cb1d84c..fc73be6 100644 --- a/LuaLibs/ProcessDrill.lua +++ b/LuaLibs/ProcessDrill.lua @@ -1,4 +1,4 @@ --- ProcessDrill.lua by Egaltech s.r.l. 2021/03/19 +-- ProcessDrill.lua by Egaltech s.r.l. 2021/03/20 -- Gestione calcolo forature per Travi -- Tabella per definizione modulo @@ -389,7 +389,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) if AreSameVectorApprox( vtExtr, Z_AX()) then nSCC = MCH_SCC.ADIR_YM elseif abs( vtExtr:getX()) < 0.1 then - local bNearTail = ( Proc.Box:getCenter():getX() < b3Solid:getCenter():getX()) + local bNearTail = ( Proc.Box:getCenter():getX() < b3Solid:getCenter():getX() and Proc.Box:getCenter():getX() - b3Solid:getMin():getX() < 1000) local bVeryShortPart = ( BD.LEN_VERY_SHORT_PART and b3Solid:getDimX() < BD.LEN_VERY_SHORT_PART) nSCC = EgtIf( BL.IsPartFinalPhase( nPhase) or ( bNearTail and not bVeryShortPart), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP) elseif vtExtr:getY() > 0.1 then diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 3304d65..1cf0fd5 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -1,10 +1,11 @@ --- ProcessLapJoint.lua by Egaltech s.r.l. 2021/03/19 +-- ProcessLapJoint.lua by Egaltech s.r.l. 2021/03/20 -- Gestione calcolo mezzo-legno per Travi -- 2019/10/08 Agg. gestione OpenPocket. -- 2021/01/24 Con sega a catena ora sempre impostato asse A. -- 2021/02/03 Corretto riconoscimento feature di coda. -- 2021/02/04 Razionalizzata gestione forzatura lama. Corretta gestione diametro minimo utensile per svuotatura. -- 2021/03/04 Due facce con testa da sotto. +-- 2021/03/20 Piccole correzioni. -- Tabella per definizione modulo local ProcessLapJoint = {} @@ -2859,7 +2860,7 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha dMachDepth = dMaxMat - (dDepth / 2) dElev = dMaxMat -- se sono in questo caso verifico la direzione, se le componenti x,y e z deviano molto - -- allora considero la lavorazione no idonea perchè potrebbe avere anche delle collisioni + -- allora considero la lavorazione non idonea perchè potrebbe avere anche delle collisioni if abs(vtOrtho:getX()) > 0.5 or abs(vtOrtho:getY()) > 0.5 or abs(vtOrtho:getZ()) > 0.5 then bBadMach = true end @@ -2893,19 +2894,19 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha bInvertMach = true end -- imposto posizione braccio porta testa + local nSCC if vtOrtho:getY() < GEO.EPS_SMALL then - if bInvertMach then - EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YP) - else - EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YM) - end + nSCC = EgtIf( bInvertMach, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM) else - if bInvertMach then - EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YM) + if abs( vtOrtho:getX()) > 0.1 then + nSCC = EgtIf( bInvertMach, MCH_SCC.ADIR_YM, MCH_SCC.ADIR_YP) else - EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YP) + local bNearTail = ( Proc.Box:getCenter():getX() < b3Solid:getCenter():getX() and Proc.Box:getCenter():getX() - b3Solid:getMin():getX() < 1000) + local bVeryShortPart = ( BD.LEN_VERY_SHORT_PART and b3Solid:getDimX() < BD.LEN_VERY_SHORT_PART) + nSCC = EgtIf( BL.IsPartFinalPhase( nPhase) or ( bNearTail and not bVeryShortPart), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP) end end + EgtSetMachiningParam( MCH_MP.SCC, nSCC) -- se tasca aperta, imposto opportuno attacco if sMchFind == 'OpenPocket' then EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALIN) @@ -2951,11 +2952,19 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha -- imposto direzione utensile opposta EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) -- imposto posizione braccio porta testa + local nSCC if vtOrtho:getY() < GEO.EPS_SMALL then - EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YP) + nSCC = MCH_SCC.ADIR_YP else - EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YM) + if abs( vtOrtho:getX()) > 0.1 then + nSCC = MCH_SCC.ADIR_YM + else + local bNearTail = ( Proc.Box:getCenter():getX() < b3Solid:getCenter():getX() and Proc.Box:getCenter():getX() - b3Solid:getMin():getX() < 1000) + local bVeryShortPart = ( BD.LEN_VERY_SHORT_PART and b3Solid:getDimX() < BD.LEN_VERY_SHORT_PART) + nSCC = EgtIf( BL.IsPartFinalPhase( nPhase) or ( bNearTail and not bVeryShortPart), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP) + end end + EgtSetMachiningParam( MCH_MP.SCC, nSCC) -- se tasca aperta, imposto opportuno attacco if sMchFind == 'OpenPocket' then EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALIN) @@ -3389,9 +3398,10 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa -- se non ho scambiato la faccia if not bUseOtherFace then if nFacInd2 then - ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd2, GDB_ID.ROOT) nFacInd, nFacInd2 = nFacInd2, nFacInd dFacElev, dFacElev2 = dFacElev2, dFacElev + ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd, GDB_ID.ROOT) + rfFac, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT) -- altrimenti cerco la faccia secondaria per adiacenza alla principale else -- Cerco una faccia adiacente alla principale sul lato lungo @@ -3917,7 +3927,6 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) else return MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead) end - -- altrimenti lavorazione unica else -- una faccia