From 10e5d79412d863690352cafb86bf1687a669dff6 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Wed, 6 Aug 2025 11:18:05 +0200 Subject: [PATCH] - in LapJoint MakeMoreFaces migliorata scelta sidemill vs catena vs svuotatura --- LuaLibs/WProcessLapJoint.lua | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/LuaLibs/WProcessLapJoint.lua b/LuaLibs/WProcessLapJoint.lua index 9bd0daa..1b36a8f 100644 --- a/LuaLibs/WProcessLapJoint.lua +++ b/LuaLibs/WProcessLapJoint.lua @@ -2895,7 +2895,7 @@ local function MakeMoreFaces( Proc, nRawId, b3Raw) local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT) local _, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT) local dMaxSlotThicknessForBlade = 19 - local bIsSmallSlot = ( Proc.Fct == 3 and ( min( dH, dV) < dMaxSlotThicknessForBlade - 10 * GEO.EPS_SMALL) and ( vtN:getZ() > -0.01) and ( vtN:getZ() < 0.5)) + local bIsSmallSlot = ( Proc.Fct == 3 and ( min( dH, dV) < dMaxSlotThicknessForBlade - 10 * GEO.EPS_SMALL) and ( vtN:getZ() > -0.01)) -- se di fianco if not bPckt and Proc.Fct >= 3 and ( ( vtN:getZ() < WD.NZ_MINA) or bIsSmallSlot) then -- recupero elevazione faccia in feature @@ -2999,12 +2999,25 @@ local function MakeMoreFaces( Proc, nRawId, b3Raw) end end end + + -- si tenta sidemill if sMilling and dElev < dMaxDepthOnSide then return MakeSideGrooveByMill( Proc, nFacInd, nRawId, b3Raw, sMilling, nil, nil, nil, nil, nil, nil, nil, bDoubleMillOnSide) - -- altrimenti sega a catena - else - return MakeByChainSaw( Proc, nFacInd, nRawId, b3Raw, dElev, dH, dV) end + -- sidemill non possibile: si tenta sega a catena + local bOk, sErr = MakeByChainSaw( Proc, nFacInd, nRawId, b3Raw, dElev, dH, dV) + if bOk then + return bOk, sErr + end + -- sega a catena fallisce: se possibile si prova con svuotatura + local nFacet = EgtIf( bPckt or vtN:getZ() >= WD.NZ_MINA, nFacInd, nFacInd2) + if nFacet then + return MakeByPocketing( Proc, nFacet, nRawId, b3Raw, true) + end + -- se nessuna strategia รจ riuscita, si ritorna errore + sErr = 'Side milling not possible' + EgtOutLog( sErr) + return false, sErr end end local nFacet = EgtIf( bPckt or vtN:getZ() >= WD.NZ_MINA, nFacInd, nFacInd2)