From 38e26b9e488b50a4a9759a4962202b62365bf953 Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Tue, 7 Oct 2025 10:11:15 +0200 Subject: [PATCH 1/5] Piccola modifica ordinamento feature --- LuaLibs/BeamExec.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index bb9c72b..92ba580 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -991,12 +991,12 @@ local function OrderFeatures( vProc, b3Raw, nPartId) if abs( B2.Box:getDimX() - b3Raw:getDimX()) < 0.2 * b3Raw:getDimX() then return not ( B1.Tail or B2.Box:getMin():getX() + 20 > B1.Box:getCenter():getX()) end - -- se primo è foro e l'altro no, lo penalizzo - if Drill.Identify(B1) and not Drill.Identify(B2) then - return ( B1.Box:getCenter():getX() > B2.Box:getMax():getX() + dDrillPenalty) + -- se primo è foro e l'altro no, lo penalizzo (a patto che il foro non attraversi nessuna feature) + if Drill.Identify(B1) and not B1.Dependency and not Drill.Identify(B2) then + return ( B1.Box:getCenter():getX() > B2.Box:getMax():getX() + dDrillPenalty) end - -- se primo è altro e secondo è foro, lo premio - if not Drill.Identify(B1) and Drill.Identify(B2) then + -- se primo è altro e secondo è foro, lo premio (a patto che il foro non attraversi nessuna feature) + if not Drill.Identify(B1) and not B2.Dependency and Drill.Identify(B2) then return ( B1.Box:getMax():getX() + dDrillPenalty > B2.Box:getCenter():getX()) end -- se prima è mortasa coda di rondine sul fianco e secondo taglio longitudinale, la coda di rondine va sempre prima From 04acc255353e7e4fb178814e656c1185cc8a663e Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Fri, 10 Oct 2025 15:37:29 +0200 Subject: [PATCH 2/5] In DtTenon, si controlla la somma di tutti i grezzi successivi e non solo il primo successivo --- LuaLibs/ProcessDtTenon.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/LuaLibs/ProcessDtTenon.lua b/LuaLibs/ProcessDtTenon.lua index e5ca83e..12f9ec4 100644 --- a/LuaLibs/ProcessDtTenon.lua +++ b/LuaLibs/ProcessDtTenon.lua @@ -212,8 +212,13 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) -- se esiste grezzo successivo non serve tagliare dal basso local bFromBottom + local dTotalLength = 0 local nNextRawId = EgtGetNextRawPart( nRawId) - if nNextRawId and EgtGetRawPartBBox( nNextRawId):getDimX() > BD.MinRaw and not Proc.Tail then + while nNextRawId do + dTotalLength = dTotalLength + EgtGetRawPartBBox( nNextRawId):getDimX() + nNextRawId = EgtGetNextRawPart( nNextRawId) + end + if dTotalLength > BD.MinRaw and not Proc.Tail then bFromBottom = false else bFromBottom = ( b3Solid:getDimX() < BD.LEN_SHORT_PART and vtExtr:getZ() > 0.25) From 1007e08e9d40453e107b415ff8d985ffbce8d2cc Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Fri, 17 Oct 2025 13:25:02 +0200 Subject: [PATCH 3/5] Se lamavorazione di base ha il flag "inverti", allora il flag si deve togliere. --- LuaLibs/ProcessProfCamb.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/LuaLibs/ProcessProfCamb.lua b/LuaLibs/ProcessProfCamb.lua index af4fc13..c4c6d88 100644 --- a/LuaLibs/ProcessProfCamb.lua +++ b/LuaLibs/ProcessProfCamb.lua @@ -796,8 +796,10 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) if bDoubleFinishMill then local sNewName = 'FinB_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local nMch2Id = EgtCopyMachining( sNewName, EgtGetName( nMchId)) + -- ottengo l'inversione e setto il contrario + local bInvertMode = EgtGetMachiningParam( MCH_MP.INVERT) + EgtSetMachiningParam( MCH_MP.INVERT, not bInvertMode) EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) - EgtSetMachiningParam( MCH_MP.INVERT, true) -- eseguo if not ML.ApplyMachining( true, false) then From 950060f4dc9c3b8b959dd7a2d772238afb050ef9 Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Mon, 27 Oct 2025 09:51:57 +0100 Subject: [PATCH 4/5] In ProcessMortise si considera il raggio minimo impostato da parametro P --- LuaLibs/ProcessMortise.lua | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) 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 From 6f14e4f2c21ad7e70261428b7bd574c988edea76 Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Mon, 27 Oct 2025 11:51:19 +0100 Subject: [PATCH 5/5] In ProcessMortise, se diametro utensile esattamente uguale a larghezza tasca, e tasca tonda, si setta un offset radiale negativo --- LuaLibs/ProcessMortise.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/LuaLibs/ProcessMortise.lua b/LuaLibs/ProcessMortise.lua index d88b919..b848abd 100644 --- a/LuaLibs/ProcessMortise.lua +++ b/LuaLibs/ProcessMortise.lua @@ -610,6 +610,7 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) bCW = ( dSpeed >= 0) end end + -- inserisco la lavorazione di svuotatura local sName = 'Mort_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local nMchFId = EgtAddMachining( sName, sPocketing) @@ -629,6 +630,11 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALIN) end + -- se diametro utensile esattamente uguale a larghezza tasca, e tasca tonda, si setta un offset radiale negativo + if Proc.Fct > 6 and abs( dMillDiam - dW) < 100 * GEO.EPS_SMALL then + EgtSetMachiningParam( MCH_MP.OFFSR, - 50 * GEO.EPS_SMALL) + end + -- aggiungo geometria EgtSetMachiningGeometry( {{ AuxId, -1}}) -- sistemo la direzione di lavoro