From 57dba9b76c3594d1cc15be6f9a6f9b78bbc690e4 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Mon, 4 Jul 2022 18:03:40 +0200 Subject: [PATCH] modifiche ulteriori al calcolo dell'affondamento --- LuaLibs/ProcessDrill.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/LuaLibs/ProcessDrill.lua b/LuaLibs/ProcessDrill.lua index cf836ab..04d512a 100644 --- a/LuaLibs/ProcessDrill.lua +++ b/LuaLibs/ProcessDrill.lua @@ -394,7 +394,8 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) EgtSetMachiningParam( MCH_MP.SCC, nSCC) -- aggiusto l'affondamento local sMyWarn - local dMaxElev = dLen + local dMaxElev = dDepth + local dToolAddLength = 0 -- se c'รจ un taglio precedente di testa o coda posso impostare MaxElev per allungare il percorso -- considero solo i fori "entranti" in testa o coda if ( Proc.MachineAfterHeadCutId and vtExtr:getX() > 0) or ( Proc.MachineAfterTailCutId and vtExtr:getX() < 0) then @@ -408,14 +409,15 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) elseif dHoleToCutDistance < 0 then dMaxElev = -dHoleToCutDistance end + dToolAddLength = dLen - dMaxElev end end - local dToolAddLength = dLen - dMaxElev if dDepth - dToolAddLength > dMaxDepth + 10 * GEO.EPS_SMALL then sMyWarn = 'Warning in drill : depth (' .. EgtNumToString( dDepth - dToolAddLength, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth, 1) .. ')' - if dMaxDepth == 0 then - dDepth = 0 - else + if dMaxDepth == 0 or dToolAddLength == 0 then + dDepth = dMaxDepth + dMaxElev = dDepth + elseif abs( dMaxElev - dDepth) > GEO.EPS_SMALL then dDepth = dLen end EgtOutLog( sMyWarn)