From fcdc31ae098086a4cd896c60a9cdcf782baff184 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Thu, 29 Aug 2019 09:11:27 +0000 Subject: [PATCH] DataBeam : - piccole correzioni e migliorie. --- LuaLibs/DiceCut.lua | 2 +- LuaLibs/ProcessLongDoubleCut.lua | 10 +++++++--- LuaLibs/ProcessMortise.lua | 14 ++++---------- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/LuaLibs/DiceCut.lua b/LuaLibs/DiceCut.lua index 5329152..6476cc3 100644 --- a/LuaLibs/DiceCut.lua +++ b/LuaLibs/DiceCut.lua @@ -359,7 +359,7 @@ function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPl end -- calcolo la direzione dei piani ortogonali local vtO = VectorFromUprightOrtho( vtNInner) - if vtNInner:getZ() > -0.05 or vtNInner:getZ() < -0.5 then + if vtNInner:getZ() > 0.05 or vtNInner:getZ() < -0.5 then vtO:rotate( vtNInner, 90) -- se diretto troppo ortogonalmente all'asse trave e taglio non da sotto, lo ruoto ulteriormente if abs( vtO:getY()) > abs( vtO:getX()) and vtNInner:getZ() > -0.5 then diff --git a/LuaLibs/ProcessLongDoubleCut.lua b/LuaLibs/ProcessLongDoubleCut.lua index ce42dfa..f134ba7 100644 --- a/LuaLibs/ProcessLongDoubleCut.lua +++ b/LuaLibs/ProcessLongDoubleCut.lua @@ -1,4 +1,4 @@ --- ProcessLongDoubleCut.lua by Egaltech s.r.l. 2019/07/17 +-- ProcessLongDoubleCut.lua by Egaltech s.r.l. 2019/08/27 -- Gestione calcolo doppio taglio longitudinale per Travi -- Tabella per definizione modulo @@ -201,6 +201,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId) -- altrimenti รจ sotto : lavorazione Long2CutDown else + local sWarn -- recupero la lavorazione local sMilling = ML.FindMilling( 'Long2CutDown') if not sMilling then @@ -261,7 +262,10 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId) -- imposto lato di lavoro e inversione EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) EgtSetMachiningParam( MCH_MP.INVERT, true) - local dDepth = min( dMaxDepth, vWidth[vOrd[i]] + dAgg) + if vWidth[vOrd[i]] + dAgg > dMaxDepth - BD.COLL_SIC then + sWarn = 'Warning in double cut : depth (' .. EgtNumToString( vWidth[vOrd[i]] + dAgg, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth - BD.COLL_SIC, 1) .. ')' + end + local dDepth = min( dMaxDepth - BD.COLL_SIC, vWidth[vOrd[i]] + dAgg) EgtSetMachiningParam( MCH_MP.DEPTH, dDepth) -- eseguo if not EgtApplyMachining( true, false) then @@ -273,7 +277,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId) end end - return true + return true, sWarn end --------------------------------------------------------------------- diff --git a/LuaLibs/ProcessMortise.lua b/LuaLibs/ProcessMortise.lua index ab28892..0a1b088 100644 --- a/LuaLibs/ProcessMortise.lua +++ b/LuaLibs/ProcessMortise.lua @@ -1,4 +1,4 @@ --- ProcessMortise.lua by Egaltech s.r.l. 2019/08/08 +-- ProcessMortise.lua by Egaltech s.r.l. 2019/08/27 -- Gestione calcolo mortase per Travi -- Tabella per definizione modulo @@ -49,15 +49,9 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId) end -- se curva aperta la allungo e chiudo if not EgtCurveIsClosed( AuxId) then - local EXTRA_LEN = 30 - local dGap = dist( EgtSP( AuxId), EgtEP( AuxId)) - if dGap <= 2 * EXTRA_LEN then - EgtAddCurveCompoArcTg( AuxId, EgtSP( AuxId)) - else - EgtExtendCurveStartByLen( AuxId, EXTRA_LEN) - EgtExtendCurveEndByLen( AuxId, EXTRA_LEN) - EgtCloseCurveCompo( AuxId) - end + local _, nCount = EgtCurveDomain( AuxId) + EgtCloseCurveCompo( AuxId) + EgtSetInfo( AuxId, 'OPEN', nCount) end -- recupero i dati del bottom local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)