diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index 5f66eb7..774421c 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -973,7 +973,7 @@ local function ClassifyFeatures( vProc, b3Raw, Stats) local bDownSideOnHeadOk = false if Proc.MachineBeforeIntersectingDrillings then - table.insert ( vMachineBeforeIntersectingDrillingsId, Proc.Id) + table.insert( vMachineBeforeIntersectingDrillingsId, Proc.Id) end -- se senza geometria (già disabilitato) diff --git a/LuaLibs/FacesBySaw.lua b/LuaLibs/FacesBySaw.lua index 4a66190..3b06698 100644 --- a/LuaLibs/FacesBySaw.lua +++ b/LuaLibs/FacesBySaw.lua @@ -184,7 +184,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw -- se la lama ruota in senso antiorario inverto la direzione di lavorazione, per avere rotazione lama opposta a avanzamento if bInvert == nil then if not BD.TURN then - if bIsSawCCW and not bDownUp then + if bIsSawCCW ~= bDownUp then bInvert = ( ptP2:getZ() < ptP1:getZ() + 100 * GEO.EPS_SMALL) else bInvert = ( ptP2:getZ() < ptP1:getZ() - 100 * GEO.EPS_SMALL) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index b268e0a..fae919f 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -1,4 +1,4 @@ --- ProcessLapJoint.lua by Egaltech s.r.l. 2023/06/06 +-- ProcessLapJoint.lua by Egaltech s.r.l. 2023/07/19 -- Gestione calcolo mezzo-legno per Travi -- 2019/10/08 Agg. gestione OpenPocket. -- 2021/01/24 Con sega a catena ora sempre impostato asse A. @@ -68,6 +68,7 @@ -- 2023/06/06 Limiti su svuotature tasche a L 4 facce come per L 3 facce. In svuotatura aggiunto recupero UserNotes da libreria per MaxOptSize. -- 2023/16/12 Corretto il recupero dati utensile che, in alcune funzioni, puntava all'utensile errato. -- 2023/06/29 Se forzata lavorazione laterale permetto l'uso del truciolatore solo se non è una tasca chiusa. +-- 2023/07/19 Correzioni e modifiche ad antischeggia con lama (#1351). -- Tabella per definizione modulo local ProcessLapJoint = {} @@ -3045,12 +3046,14 @@ local function MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw, nFacInd, bReduceDe local dSawDiam = 400 local dSawThick = 0 local dMaxDepth = 0 + local bSawCCW = false if EgtMdbSetCurrMachining( sCutting) then local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam dSawThick = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dSawThick dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth + bSawCCW = ( EgtTdbGetCurrToolParam( MCH_TP.SPEED) < 0) end end local dExtraOffs = 0 @@ -3075,8 +3078,10 @@ local function MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw, nFacInd, bReduceDe end end -- eseguo il taglio - local dVzLimDwnUp = EgtIf( BD.TURN, -2, nil) - local bMadeASbyBld, sWarn, nIdMach = Fbs.MakeOne( Proc.Id, nFacet, sCutting, dSawDiam, vtN, dVzLimDwnUp, ( -0.5 + dExtraOffs), BD.CUT_SIC, 0, 0, 0, nil, b3Raw) + local vtNfac = EgtSurfTmFacetNormVersor( Proc.Id, nFacet, GDB_ID.ROOT) + local dVzLimDwnUp = EgtIf( BD.TURN, -2, BL.GetNzLimDownUp( b3Raw, vtNfac, vtN)) + local bInvert = ( bSawCCW ~= ( vtNfac:getZ() < dVzLimDwnUp)) + local bMadeASbyBld, sWarn, nIdMach = Fbs.MakeOne( Proc.Id, nFacet, sCutting, dSawDiam, vtN, dVzLimDwnUp, ( -0.5 + dExtraOffs), BD.CUT_SIC, 0, 0, 0, nil, b3Raw, bInvert) if bMadeASbyBld then sWarn = nil if not bReduceDepth and abs(dExtraOffs) > 0 then @@ -3966,7 +3971,6 @@ local function ManageAntiSplintBySaw( Proc, b3Raw, bIsU, vtN, nFacInd, sWarn, bM if nIdMach then -- verifico se da invertire local bInvertMach = false - local dDepth = 0 if bIsU then -- prendo il vettore normale alla faccia local vtNFc = EgtSurfTmFacetNormVersor( Proc.Id, nFacet, GDB_ID.ROOT) @@ -4001,40 +4005,22 @@ local function ManageAntiSplintBySaw( Proc, b3Raw, bIsU, vtN, nFacInd, sWarn, bM -- eseguo inversione if bInvertMach then local bToolInvert = EgtGetMachiningParam( MCH_MP.TOOLINVERT) - local nWS = EgtGetMachiningParam( MCH_MP.WORKSIDE) - local nInvWS = EgtIf( nWS == MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT) + local bInvert = EgtGetMachiningParam( MCH_MP.INVERT) local nFaceUse = EgtGetMachiningParam( MCH_MP.FACEUSE) local bOrtUp = ( nFaceUse >= MCH_MILL_FU.ORTUP_DOWN and nFaceUse <= MCH_MILL_FU.ORTUP_RIGHT) if not bOrtUp then -- assegno i parametri invertiti - EgtSetMachiningParam( MCH_MP.WORKSIDE, nInvWS) EgtSetMachiningParam( MCH_MP.TOOLINVERT, not bToolInvert) + EgtSetMachiningParam( MCH_MP.INVERT, not bInvert) -- setto l'offset pari allo spessore lama EgtSetMachiningParam( MCH_MP.OFFSL, -dSawThick) end end - -- per diminuire scheggiature su facce davanti - if nPrefSide == 2 then - local dSpeed = EgtGetMachiningParam( MCH_MP.SPEED) - if dSpeed < 0 and vtN:getY() < -0.996 then - EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) - EgtSetMachiningParam( MCH_MP.INVERT, vtNFc:getX() > 0) - elseif dSpeed > 0 and vtN:getY() > 0.996 then - EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) - EgtSetMachiningParam( MCH_MP.INVERT, vtNFc:getX() < 0) - elseif dSpeed < 0 and vtN:getZ() > 0.996 then - EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) - EgtSetMachiningParam( MCH_MP.INVERT, vtNFc:getX() > 0) - elseif dSpeed > 0 and vtN:getZ() > 0.996 then - EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) - EgtSetMachiningParam( MCH_MP.INVERT, vtNFc:getX() < 0) - end - end end -- posizione del braccio : se primo taglio la recupero, altrimenti la imposto if not nPrevSCC then nPrevSCC = EgtGetMachiningParam( MCH_MP.SCC) - else + elseif abs( vtN:getZ()) > 0.996 then EgtSetMachiningParam( MCH_MP.SCC, nPrevSCC) end -- rieseguo diff --git a/Version.lua b/Version.lua index dcc80b4..62b7ad8 100644 --- a/Version.lua +++ b/Version.lua @@ -1,6 +1,6 @@ --- Version.lua by Egaltech s.r.l. 2023/06/08 +-- Version.lua by Egaltech s.r.l. 2023/07/19 -- Gestione della versione di Beam NAME = 'Beam' -VERSION = '2.5g1' +VERSION = '2.5g2' MIN_EXE = '2.5c1'