diff --git a/LuaLibs/ProcessMortise.lua b/LuaLibs/ProcessMortise.lua index e29ce07..d88b919 100644 --- a/LuaLibs/ProcessMortise.lua +++ b/LuaLibs/ProcessMortise.lua @@ -353,6 +353,18 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) BL.SetOpenSide( AuxId, b3Solid) end + -- recupero il raggio minimo della mortasa + local dMaxDiam = 1000 + local nSt, nEnd = EgtCurveDomain( AuxId) + for i = nSt, nEnd - 1 do + local dRad = EgtCurveCompoRadius( AuxId, i) + -- se รจ un raggio, setto ed esco subito. Tutti i raggi sono uguali nella mortasa + if dRad > 0 then + dMaxDiam = dRad * 2 + break + end + end + -- caso speciale feature trimmata diversamente in/out: si ricostruisce la curva non trimmata -- recupero gruppo per geometria addizionale local nAddGrpId = BL.GetAddGroup( nPartId) @@ -486,6 +498,10 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) end -- determino larghezza della mortasa if dL < dW then dL, dW = dW, dL end + + -- si prende il minimo tra larghezza mortasa e il raggio minimo impostato da parametro + dMaxDiam = min( dW, dMaxDiam) + -- abilitazione lavorazione da sotto local bPockUp = ( BD.DOWN_HEAD and vtExtr:getZ() > -0.259) local bPockDown = ( BD.DOWN_HEAD and vtExtr:getZ() < 0.174) @@ -564,16 +580,16 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) end local sPocketing if Proc.Prc ~= 53 then - sPocketing = ProcessMortise.VerifyMortiseOrPocket( Proc, dW, dMorH, nil, sPockType..sMchExt, bPockDown, bExcludeH2) + sPocketing = ProcessMortise.VerifyMortiseOrPocket( Proc, dMaxDiam, dMorH, nil, sPockType..sMchExt, bPockDown, bExcludeH2) if not sPocketing and bPockUp then - sPocketing = ProcessMortise.VerifyMortiseOrPocket( Proc, dW, dMorH, nil, sPockType..sMchExt, _, bExcludeH2) + sPocketing = ProcessMortise.VerifyMortiseOrPocket( Proc, dMaxDiam, dMorH, nil, sPockType..sMchExt, _, bExcludeH2) end end if not sPocketing then sPockType = 'Pocket' - sPocketing = ProcessMortise.VerifyMortiseOrPocket( Proc, dW, dMorH, nil, sPockType..sMchExt, bPockDown, bExcludeH2) + sPocketing = ProcessMortise.VerifyMortiseOrPocket( Proc, dMaxDiam, dMorH, nil, sPockType..sMchExt, bPockDown, bExcludeH2) if not sPocketing and bPockUp then - sPocketing = ProcessMortise.VerifyMortiseOrPocket( Proc, dW, dMorH, nil, sPockType..sMchExt, _, bExcludeH2) + sPocketing = ProcessMortise.VerifyMortiseOrPocket( Proc, dMaxDiam, dMorH, nil, sPockType..sMchExt, _, bExcludeH2) end end if not sPocketing then