diff --git a/LuaLibs/WProcessLapJoint.lua b/LuaLibs/WProcessLapJoint.lua index 04a0e57..371b113 100644 --- a/LuaLibs/WProcessLapJoint.lua +++ b/LuaLibs/WProcessLapJoint.lua @@ -2288,6 +2288,10 @@ local function VerifyPocket( Proc, nFacet, dElev, nRawId) local _, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacet, GDB_ID.ROOT) local dStartDiameter = min( dH, dV) local dMaxDiameter = dStartDiameter + -- se tasca chiusa si riduce il massimo diametro per evitare che la svuotatura fallisca + if Proc.Topology == 'Pocket' or Proc.Topology == 'Tunnel' then + dMaxDiameter = 0.9 * dStartDiameter + end -- se una sola faccia posso usare un utensile più grande della faccia if Proc.Fct == 1 then dMaxDiameter = 2 * dMaxDiameter @@ -2295,7 +2299,12 @@ local function VerifyPocket( Proc, nFacet, dElev, nRawId) -- se forma ad L posso usare un utensile più grande della faccia local bIsL = ( Proc.Fct == 2 or WL.TestElleShape3( Proc.Id, Proc.Fct) or WL.TestElleShape4( Proc.Id, Proc.Fct) == 2) if bIsL then - dMaxDiameter = 2 * dMaxDiameter + if Proc.Fct < 4 then + dMaxDiameter = 2 * dMaxDiameter + -- per tasche chiuse l'utensile non può essere più grande del lato più grande + else + dMaxDiameter = min( 2 * dMaxDiameter, max( dH, dV)) + end end -- se forma ad U riduco il diametro se necessario local bIsU = ( Proc.Fct == 3 and not WL.TestElleShape3( Proc.Id, Proc.Fct)) @@ -2389,7 +2398,7 @@ local function VerifyPocket( Proc, nFacet, dElev, nRawId) -- se tasca chiusa cerco lavorazione con diametro massimo pari a dimensione tasca e riverifico per eventuale doppio if bForceClosedPocket then - dMaxDiameter = dStartDiameter + dMaxDiameter = 0.9 * dStartDiameter bUseDElevToFindPocketing = true sPocketing = WM.FindPocketing( 'Pocket', dMaxDiameter, dElev, nil, nil, bExcludeNoTipFeed, dDistanceToNearestPart) if not sPocketing then