From acc6cc020b8d0bb98fe757bf797b82e478e063c1 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 22 Mar 2021 14:53:55 +0000 Subject: [PATCH] DataBeam : - correzioni varie. --- LuaLibs/ProcessLapJoint.lua | 42 ++++++++++++++----------------- LuaLibs/ProcessStepJointNotch.lua | 10 +++++--- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 1cf0fd5..4848327 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -725,7 +725,7 @@ local function MakeOneFaceByMill( Proc, nPhase, nRawId, nPartId) end --------------------------------------------------------------------- -local function MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId) +local function MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId, bDownHead) -- recupero l'ingombro del grezzo di appartenenza local b3Raw = EgtGetRawPartBBox( nRawId) -- recupero l'ingombro della trave @@ -742,9 +742,9 @@ local function MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId) -- verifico il parametro Q per uso fresa local nUseRM = EgtGetInfo( Proc.Id, Q_USE_MILL, 'i') if nUseRM and nUseRM == 1 then - sMilling = ML.FindMilling( 'LongSmallCut') + sMilling = ML.FindMilling( 'LongSmallCut' .. EgtIf( bDownHead, '_H2', '')) else - sMilling = ML.FindMilling( 'BirdsMouth') + sMilling = ML.FindMilling( 'BirdsMouth' .. EgtIf( bDownHead, '_H2', '')) end -- recupero la lavorazione local dTDiam = 0 @@ -770,7 +770,7 @@ local function MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId) local bFaceOk = {} bFaceOk[1] = ( vtN[1]:getZ() >= BD.NZ_MINB) bFaceOk[2] = ( vtN[2]:getZ() >= BD.NZ_MINB) - if not bFaceOk[1] and not bFaceOk[2] then + if not bDownHead and not bFaceOk[1] and not bFaceOk[2] then local sErr = 'Error : LapJoint from bottom impossible' EgtOutLog( sErr) return false, sErr @@ -2895,16 +2895,14 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha end -- imposto posizione braccio porta testa local nSCC - if vtOrtho:getY() < GEO.EPS_SMALL then + if abs( vtOrtho:getX()) < 0.02 and abs( vtOrtho:getY()) > 0.02 then + 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 vtOrtho:getY() < GEO.EPS_SMALL then nSCC = EgtIf( bInvertMach, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM) else - if abs( vtOrtho:getX()) > 0.1 then - nSCC = EgtIf( bInvertMach, MCH_SCC.ADIR_YM, MCH_SCC.ADIR_YP) - 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 + nSCC = EgtIf( bInvertMach, MCH_SCC.ADIR_YM, MCH_SCC.ADIR_YP) end EgtSetMachiningParam( MCH_MP.SCC, nSCC) -- se tasca aperta, imposto opportuno attacco @@ -2953,16 +2951,14 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) -- imposto posizione braccio porta testa local nSCC - if vtOrtho:getY() < GEO.EPS_SMALL then + if abs( vtOrtho:getX()) < 0.02 and abs( vtOrtho:getY()) > 0.02 then + 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 vtOrtho:getY() < GEO.EPS_SMALL then nSCC = MCH_SCC.ADIR_YP else - 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 + nSCC = MCH_SCC.ADIR_YM end EgtSetMachiningParam( MCH_MP.SCC, nSCC) -- se tasca aperta, imposto opportuno attacco @@ -3953,10 +3949,10 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) -- determino l'angolo tra le facce local bAdj, _, _, dAng = EgtSurfTmFacetsContact( Proc.Id, 0, 1, GDB_ID.ROOT) -- se ortogonali e non forzata lama oppure con testa da sotto, con fresa - if ( not bUseBlade and bAdj and abs( dAng + 90) < 1) or bDownHead then + if ( not bUseBlade or bDownHead) and bAdj and abs( dAng + 90) < 1 then -- se piccole if ( Proc.Box:getDimX() < MAX_MILL_LIN and ( Proc.Box:getDimZ() < MAX_MILL_LIN or Proc.Box:getDimY() < MAX_MILL_LIN)) then - return MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId) + return MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId, bDownHead) else return MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, true) end @@ -3987,7 +3983,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) local nOk, sErr = MakeChamfer( Proc, true, nAddGrpId, vtOrtho, b3Solid, nSurfInt, dDepthCham) if nOk < 0 then return false, sErr end end - return Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, 'HeadSide') + return Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, 'HeadSide' .. EgtIf( bDownHead, '_H2', ''), true, bDownHead) end -- tre o più facce else diff --git a/LuaLibs/ProcessStepJointNotch.lua b/LuaLibs/ProcessStepJointNotch.lua index a708460..ac18721 100644 --- a/LuaLibs/ProcessStepJointNotch.lua +++ b/LuaLibs/ProcessStepJointNotch.lua @@ -1,4 +1,4 @@ --- ProcessStepJointNotch.lua by Egaltech s.r.l. 2020/12/01 +-- ProcessStepJointNotch.lua by Egaltech s.r.l. 2021/03/21 -- Gestione calcolo tacca a gradino per Travi -- Tabella per definizione modulo @@ -264,10 +264,13 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, ptC, vtN, end -- recupero i dati dell'utensile local dTDiam = 50 + local bCW = true if EgtMdbSetCurrMachining( sMilling) then local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dTDiam + local dSpeed = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) or 0 + bCW = ( dSpeed >= 0) end end -- Calcolo uso faccia @@ -284,8 +287,9 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, ptC, vtN, EgtSetMachiningGeometry( {{ Proc.Id, (nSmaInd-1)}}) -- imposto uso faccia EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse) - -- setto inversione del percorso - EgtSetMachiningParam( MCH_MP.INVERT, true) + -- setto inversione del percorso e lato di lavoro + EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bCW, true, false)) + EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bCW, MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT)) -- setto a 0 eventuali offset EgtSetMachiningParam( MCH_MP.OFFSR, 0) -- applico gli allungamenti o accorciamenti considerando che la lavorazione è invertita