From e80e4e8a5d0dbe9aea049489b35d38a5fb12564c Mon Sep 17 00:00:00 2001 From: DarioS Date: Thu, 29 Jun 2023 18:27:31 +0200 Subject: [PATCH] =?UTF-8?q?DataBeam=20:=20-=20in=20DiceCut=20modificata=20?= =?UTF-8?q?scelta=20tagli=20ortogonali=20quando=20liberi=20(esteso=20caso?= =?UTF-8?q?=20di=20verticali=20ammessi)=20-=20migliorato=20controllo=20fat?= =?UTF-8?q?tibilit=C3=A0=20taglio=20di=20fianco=20con=20cubetti=20-=20in?= =?UTF-8?q?=20LapJoint=20estesi=20casi=20riconoscimento=20in=20coda=20basa?= =?UTF-8?q?to=20su=20lunghezza.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/DiceCut.lua | 4 ++-- LuaLibs/ProcessCut.lua | 31 ++++++++++++++++++------------- LuaLibs/ProcessLapJoint.lua | 4 ++-- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/LuaLibs/DiceCut.lua b/LuaLibs/DiceCut.lua index d07cfff..c8bb109 100644 --- a/LuaLibs/DiceCut.lua +++ b/LuaLibs/DiceCut.lua @@ -1,4 +1,4 @@ --- DiceCut.lua by Egaltech s.r.l. 2023/02/05 +-- DiceCut.lua by Egaltech s.r.l. 2023/06/29 -- Gestione dei piano paralleli nei tagli lunghi: equidistanziamento dei piani paralleli -- Tabella per definizione modulo @@ -473,7 +473,7 @@ function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPl if vtNInner:getZ() > -0.0175 or vtNInner:getZ() < dNzLimDwnUp or abs( vtNInner:getY()) > 0.8 then vtO:rotate( vtNInner, 90) -- se diretto troppo ortogonalmente all'asse trave e taglio non da sotto, lo ruoto ulteriormente - if ( abs( vtO:getY()) > 3 * abs( vtO:getX()) or BBoxRawPart:getDimZ() > 620) and vtNInner:getZ() > dNzLimDwnUp then + if ( abs( vtO:getY()) > 4 * abs( vtO:getX()) or BBoxRawPart:getDimZ() > 620) and vtNInner:getZ() > dNzLimDwnUp then vtO:rotate( vtNInner, 90) -- se faccia principale verso il basso (almeno -3deg), lo inverto per iniziare da sopra if vtNInner:getZ() < -0.05 then diff --git a/LuaLibs/ProcessCut.lua b/LuaLibs/ProcessCut.lua index 7033d40..cb32fac 100644 --- a/LuaLibs/ProcessCut.lua +++ b/LuaLibs/ProcessCut.lua @@ -399,12 +399,12 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b -- per caso speciale in cui c'è il rischio che il cubetto rimanga appoggiato sul motore, faccio solo i tagli perpendicolari seguiti da due tagli verticali laterali local bDangerousReliefCut = false - local frFace = BL.GetFaceHvRefDim( Proc.Id, 0) -- verifico che i tagli perpendicolari siano perpendicolari al lato più vicino a Z - local nFirstPerpendicularCut = ( #vCuts ~= 0 and ( vCuts[1][1] or vCuts[3][1])) + local nFirstPerpendicularCut = ( #vCuts > 0 and ( vCuts[1][1] or vCuts[3][1])) if nFirstPerpendicularCut then + local frFace = BL.GetFaceHvRefDim( Proc.Id, 0) local vtTemp = EgtSurfTmFacetNormVersor( nFirstPerpendicularCut, 0, GDB_ID.ROOT) ^ frFace:getVersX() - if #vCuts > 0 and not ( vtTemp:isSmall()) and not ( bDownCut or bFromBottom) and not bLongCut then + if not ( vtTemp:isSmall()) and not ( bDownCut or bFromBottom) and not bLongCut then bDangerousReliefCut = true end end @@ -467,17 +467,22 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b end end end - local _, dDiceFaceH = BL.GetFaceHvRefDim( vCuts[i][1] or GDB_ID.NULL, 0) - -- caso speciale con rischio cubetto sul motore - if ( i % 2 == 0) and bDangerousReliefCut and ( dMaxDepth * 2 > dDiceFaceH + BD.CUT_EXTRA) then - local bDoubleCut = false - local nSurfToCut - local dCutExtra = BD.CUT_EXTRA - if dMaxDepth < dDiceFaceH + BD.CUT_EXTRA then - bDoubleCut = true - dCutExtra = - 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA + local dDiceFaceMaxH = 0 + if ( i % 2) == 0 and bDangerousReliefCut then + for j = 1, #vCuts[i] do + local _, dDiceFaceH = BL.GetFaceHvRefDim( vCuts[i][j] or GDB_ID.NULL, 0) + dDiceFaceMaxH = max( dDiceFaceMaxH, dDiceFaceH) end - nSurfToCut = EgtSurfTmBySewing( nAddGrpId, vCuts[i], false) + end + -- caso speciale con rischio cubetto sul motore + if ( i % 2) == 0 and bDangerousReliefCut and ( dMaxDepth > dDiceFaceMaxH / 2 + BD.CUT_EXTRA_MIN) then + local bDoubleCut = false + local dCutExtra = BD.CUT_EXTRA + if dMaxDepth < dDiceFaceMaxH + BD.CUT_EXTRA then + bDoubleCut = true + dCutExtra = - 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN + end + local nSurfToCut = EgtSurfTmBySewing( nAddGrpId, vCuts[i], false) local nFaceUseCut1, nFaceUseCut2 = MCH_MILL_FU.ORTHO_BACK, MCH_MILL_FU.ORTHO_FRONT if Proc.Tail then nFaceUseCut1, nFaceUseCut2 = nFaceUseCut2, nFaceUseCut1 diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index d163be8..6cf46d6 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -667,9 +667,9 @@ function ProcessLapJoint.IsTailFeature( Proc, b3Raw) if dEndDist > BD.MAX_DIST_HTFEA then return false end - -- se lunga come trave, oppure non è trave corta e la sua lunghezza supera il massimo o il 70% della lunghezza della trave + -- se lunga come trave, oppure non è trave corta e la sua lunghezza supera il massimo o il 80% della lunghezza della trave if Proc.Box:getDimX() > b3Solid:getDimX() - 1 or - ( b3Solid:getDimX() > BD.LEN_SHORT_PART and Proc.Box:getDimX() > min( BD.MAX_LEN_HTFEA, 0.7 * b3Solid:getDimX())) then + ( b3Solid:getDimX() > BD.LEN_SHORT_PART and Proc.Box:getDimX() > min( BD.MAX_LEN_HTFEA, 0.8 * b3Solid:getDimX())) then return false end -- se una o due facce e interessa veramente la coda, allora di coda