From 4c239cf6a79dd951b5302a81b53280bddc480e14 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Fri, 20 Jan 2023 14:56:57 +0100 Subject: [PATCH] =?UTF-8?q?Feature/L010MillStopIfUnloadableRawPiece:=20-?= =?UTF-8?q?=20ora=20la=20LongCut=20accorcia=20il=20percorso=20del=20trucio?= =?UTF-8?q?latore=20se=20il=20grezzo=20rimanente=20=C3=A8=20scaricabile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/ProcessLongCut.lua | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/LuaLibs/ProcessLongCut.lua b/LuaLibs/ProcessLongCut.lua index 874cdd0..f66ab25 100644 --- a/LuaLibs/ProcessLongCut.lua +++ b/LuaLibs/ProcessLongCut.lua @@ -554,7 +554,13 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus EgtOutLog( sErr) return false, sErr end - + + -- verifico se la parte rimanente della barra è riutilizzabile + local nNextRawId = EgtGetNextRawPart( nRawId) + local bIsNextRawPartUnloadable = nNextRawId and + EgtGetPartInRawPartCount( nNextRawId) <= 0 and + EgtGetRawPartBBox( nNextRawId):getDimX() >= BD.MinRaw + -- Se non limitato o forzato uso lama e da sopra e richiesto con doppio taglio di lama e superiore al limite minimo if ( ( not bLimXmin and not bLimXmax) or bForceUseBladeOnNotThruFace) and ( bCanUseUnderBlade or bCanUseBlade) and nUseBlade > 0 and b3Solid:getDimX() > dLimMinPiece - 1 then local sCutting @@ -601,9 +607,8 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus end end end - local nNextRawId = EgtGetNextRawPart( nRawId) -- se la fine (a sinistra) non è limitata e ho un pezzo successivo meno distante di metà raggio, oppure se grezzo finale della barra di lunghezza sufficiente, setto la fine come limitata - if ((( bCanUseBlade or bCanUseUnderBlade) and ( dDistToNextPiece < dToolDiam/2 or dDistToNextPiece < dToolDiamDn/2)) or (nNextRawId and EgtGetPartInRawPartCount( nNextRawId) <= 0 and EgtGetRawPartBBox( nNextRawId):getDimX() >= BD.MinRaw)) and not bLimXmin then + if ((( bCanUseBlade or bCanUseUnderBlade) and ( dDistToNextPiece < dToolDiam/2 or dDistToNextPiece < dToolDiamDn/2)) or bIsNextRawPartUnloadable) and not bLimXmin then if bForceUseBladeOnNotThruFace then bForcedLim = true bLimXmin = true @@ -999,8 +1004,8 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth end end - -- se la fine (a sinistra) non è limitata e ho un pezzo successivo meno distante di metà raggio. setto la fine come limitata - if dDistToNextPiece < dToolDiam/2 and not bLimXmin then + -- se la fine (a sinistra) non è limitata e ho un pezzo successivo meno distante di metà raggio, oppure se grezzo finale della barra di lunghezza sufficiente, setto la fine come limitata + if ( dDistToNextPiece < dToolDiam/2 or bIsNextRawPartUnloadable) and not bLimXmin then bForcedLim = true bLimXmin = true end