From 59ad02fcf8209880c0a8e0ab292fb0f4af7c8904 Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Thu, 25 Jun 2026 11:24:02 +0200 Subject: [PATCH] Per identificare feature di testa, oltre che verificare se sia troncante, si controlla anche la feature taglio --- LuaLibs/BeamExec.lua | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index 3bc1560..80ebab5 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -443,7 +443,7 @@ local function CalcHeadTailMachBeforeIntersDrillings( vProc, b3Raw) for i = 1, #vProc do local Proc = vProc[i] if Proc.Box and not Proc.Box:isEmpty() then - if Proc.Fct == 1 and BL.IsFeatureCuttingEntireSection( Proc.Box, b3Raw:getDimY(), b3Raw:getDimZ()) and ( Proc.Head or Proc.Tail) and Proc.Prc ~= 350 then + if Proc.Fct == 1 and ( BL.IsFeatureCuttingEntireSection( Proc.Box, b3Raw:getDimY(), b3Raw:getDimZ()) or Cut.Identify( Proc)) and ( Proc.Head or Proc.Tail) and Proc.Prc ~= 350 then if Proc.Head and Proc.Box:getCenter():getX() < dHeadX then dHeadX = Proc.Box:getCenter():getX() nHeadId = Proc.Id @@ -915,6 +915,22 @@ local function ReorderFeatureWithDependency( vProc) table.insert( vProc, nRefIndex, table.remove( vProc, i)) i = max( nRefIndex - 1, 1) end + elseif Drill.Identify( vProc[i]) and vProc[i].Dependency and vProc[i].Dependency.ExecAfter and vProc[i].Dependency.ExecAfter.Id then + local nRefId = vProc[i].Dependency.ExecAfter.Id + local nRefIndex + + for j = 1, #vProc do + if i ~= j and vProc[j].Id == nRefId then + nRefIndex = j + break + end + end + + -- se il processo deve stare dopo, ma ora รจ prima + if nRefIndex and nRefIndex > i then + table.insert( vProc, nRefIndex, table.remove( vProc, i)) + i = max( nRefIndex - 1, 1) + end end i = i + 1 end