diff --git a/LuaLibs/WProcessCut.lua b/LuaLibs/WProcessCut.lua index cff0592..b8ab00b 100644 --- a/LuaLibs/WProcessCut.lua +++ b/LuaLibs/WProcessCut.lua @@ -1,4 +1,4 @@ --- WProcessCut.lua by Egaltech s.r.l. 2020/11/13 +-- WProcessCut.lua by Egaltech s.r.l. 2020/11/25 -- Gestione calcolo taglio di testa o longitudinale per Pareti -- Tabella per definizione modulo @@ -8,6 +8,7 @@ local WPC = {} require( 'EgtBase') local WL = require( 'WallLib') local FreeContour = require( 'WProcessFreeContour') +local LapJoint = require( 'WProcessLapJoint') EgtOutLog( ' WProcessCut started', 1) @@ -29,7 +30,7 @@ function WPC.Classify( Proc, b3Raw) -- verifico abbia una sola faccia if Proc.Fct ~= 1 then return false end -- controllo la normale - local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT) + local vtN = EgtSurfTmFacetNormVersor( Proc.Id, 0, GDB_ID.ROOT) if vtN:getZ() < - 0.5 then return false end return true end @@ -41,7 +42,7 @@ function WPC.FlipClassify( Proc) -- verifico abbia una sola faccia if Proc.Fct ~= 1 then return 0, 0 end -- controllo la normale - local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT) + local vtN = EgtSurfTmFacetNormVersor( Proc.Id, 0, GDB_ID.ROOT) local vtNZ = vtN:getZ() if vtNZ > - GEO.EPS_SMALL then nFlip0 = 100 @@ -67,7 +68,12 @@ end --------------------------------------------------------------------- -- Applicazione della lavorazione function WPC.Make( Proc, nRawId, b3Raw) - return FreeContour.Make( Proc, nRawId, b3Raw) + local vtN = EgtSurfTmFacetNormVersor( Proc.Id, 0, GDB_ID.ROOT) + if vtN :getZ() > 0.866 then + return LapJoint.Make( Proc, nRawId, b3Raw) + else + return FreeContour.Make( Proc, nRawId, b3Raw) + end end --------------------------------------------------------------------- diff --git a/LuaLibs/WProcessLapJoint.lua b/LuaLibs/WProcessLapJoint.lua index 3fbc615..1838a8e 100644 --- a/LuaLibs/WProcessLapJoint.lua +++ b/LuaLibs/WProcessLapJoint.lua @@ -1,4 +1,4 @@ --- WProcessLapJoint.lua by Egaltech s.r.l. 2022/02/04 +-- WProcessLapJoint.lua by Egaltech s.r.l. 2022/11/15 -- Gestione calcolo mezzo-legno per Pareti -- 2021/08/27 DS Se tre o più facce con flag PCKT=1 forzo svuotatura con fresa (per Variant). -- 2021/08/29 DS Se svuotatura di fianco setto flag per farla dopo i tagli. @@ -9,6 +9,7 @@ -- 2022/01/17 ES Migliorata scelta fresa per lavorazione di fianco sotto. -- 2022/02/03 DS Gorge larga come gambo più sicurezza. -- 2022/02/04 DS In svuotatura aggiunta gestione WD.MAXDIAM_POCK_CORNER in presenza di almeno un angolo interno. +-- 2022/11/15 DS Con lama massima inclinazione 60deg. -- Tabella per definizione modulo local WPL = {} @@ -2012,6 +2013,10 @@ local function MakeByPocketing( Proc, nFacet, nRawId, b3Raw, bCheckQPar) -- gruppo ausiliario local nAddGrpId = WL.GetAddGroup( Proc.PartId) local nNewProc, nNumFacet = RemoveBottomFaceAndReorder( Proc, nAddGrpId, nFacet) + -- se una sola faccia + if Proc.Fct == 1 then + dDiam = 2 * dDiam + end -- se forma ad L local bIsL = ( Proc.Fct == 2 or TestElleShape3( Proc.Id, Proc.Fct) or TestElleShape4( Proc.Id, Proc.Fct) == 2) if bIsL then @@ -2363,7 +2368,7 @@ local function MakeTwoFaces( Proc, nRawId, b3Raw) if bOk then return true end end -- se non inclinate o capacità di taglio non sufficiente o non molto grandi (80mm), provo con contornatura o svuotatura - if not sCutting or dSawMaxDepth < dDimY[1] + WD.CUT_SIC or dSawMaxDepth < dDimY[2] + WD.CUT_SIC or dDimY[1] < 80 or dDimY[2] < 80 then + if vtN:getZ() > 0.866 or vtNV:getZ() > 0.866 or not sCutting or dSawMaxDepth < dDimY[1] + WD.CUT_SIC or dSawMaxDepth < dDimY[2] + WD.CUT_SIC or dDimY[1] < 80 or dDimY[2] < 80 then -- eseguo la svuotatura return MakeByPocketing( Proc, nFacet, nRawId, b3Raw) end