From 48a1139eeac41e4e46a7d4a24e4de8f0e7969469 Mon Sep 17 00:00:00 2001 From: "daniele.nicoli" Date: Fri, 27 Feb 2026 15:31:47 +0100 Subject: [PATCH] - BeamExec, tolta duplicazione pre-foro nella BeamExec.ProcessBeam() - ProcessDrill, sistemata dichiarazione local di alcune variabili usate anche dopo l'if --- LuaLibs/BeamExec.lua | 6 +++--- LuaLibs/ProcessDrill.lua | 10 ++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index a095279..7565fd6 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -304,7 +304,7 @@ local function NeedTopologyFeature( Proc) end ------------------------------------------------------------------------------------------------------------- -local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT) +local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT, bCreatePreDrill) local dRawW = b3Raw:getDimY() local dRawH = b3Raw:getDimZ() -- recupero le feature @@ -365,7 +365,7 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT) -- assegno diametro e facce di ingresso e uscita (dati tabelle sempre per riferimento) Proc.Diam, Proc.Len, Proc.Fcs, Proc.Fce = Drill.GetData( Proc, b3Raw) -- verifico se devo inserire i prefori - if Drill.IsPredrillNeeded( Proc) then + if Drill.IsPredrillNeeded( Proc) and bCreatePreDrill then local bAddProc, PredrillProc= Drill.AddPredrillFromDrillProc( Proc) if bAddProc then table.insert( vProc, PredrillProc) @@ -2315,7 +2315,7 @@ function BeamExec.ProcessFeatures() local dCurrOvmH = EgtGetInfo( nRawId, 'HOVM', 'd') or 0 local dCurrOvmT = EgtGetInfo( nRawId, 'TOVM', 'd') or 0 -- recupero le feature di lavorazione della trave - local vProc = CollectFeatures( nPartId, b3Raw, dCurrOvmH, dCurrOvmT) + local vProc = CollectFeatures( nPartId, b3Raw, dCurrOvmH, dCurrOvmT, true) -- recupero informazioni ausiliarie feature e dipendenze tra feature stesse GetFeatureInfoAndDependency( vProc, b3Raw, nPartId) diff --git a/LuaLibs/ProcessDrill.lua b/LuaLibs/ProcessDrill.lua index 49fa2b9..0b5ddba 100644 --- a/LuaLibs/ProcessDrill.lua +++ b/LuaLibs/ProcessDrill.lua @@ -387,10 +387,11 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) EgtOutLog( sErr) return false, sErr end + local nFac, CosB -- se non già richiesta inversione e invertibile if not bToInvert and Proc.Flg == 1 and -vtExtr:getZ() >= BD.DRILL_VZ_MIN then -- se il foro è cieco o dalla faccia sotto o troppo inclinato all'inizio, lo inverto - local nFac, CosB, _ = GetHoleStartData( ptCen, vtExtr, b3Solid) + nFac, CosB, _ = GetHoleStartData( ptCen, vtExtr, b3Solid) if Proc.Fcs == 0 or (( nFac == 2 or CosB > BD.DRILL_VX_MAX) and bOpen) then bToInvert = true end @@ -422,10 +423,11 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) -- primo gruppo di controlli con lunghezza utensile pari a metà foro se passante -- recupero la lavorazione local sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth, bDrillUp, bDrillDown, bExcludeH2, bDrillAngTrasm, Proc.IsPredrill) - + local dMaxDepthOri + local vFaces if sDrilling then -- Determino la faccia di inizio del foro e dati correlati - local nFac, CosB, vFaces = GetHoleStartData( ptCen, vtExtr, b3Solid) + nFac, CosB, vFaces = GetHoleStartData( ptCen, vtExtr, b3Solid) -- Calcolo acciorciamento affondamento utile per evitare collisione portautensile con faccia local TgA = CosB / sqrt( 1 - CosB * CosB) local dSubL = ( dDiamTh / 2 + ( Proc.Diam - dToolDiam) / 2 + 4) * TgA @@ -433,7 +435,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) if BD.C_SIMM and CosB > 0.866 then dSubL = ( 190 / 2 + ( Proc.Diam - dToolDiam) / 2 + 4) * TgA - 116 end - local dMaxDepthOri = dMaxDepth + dMaxDepthOri = dMaxDepth dMaxDepth = min( dMaxDepth, max( dToolFreeLen - dSubL, 0)) -- se utensile scelto non arriva in fondo, cerco il più lungo if dMaxDepth < GEO.EPS_SMALL * 10 then