From 13f0545ebe7cd9d0ed37be7537a6bada2662fe77 Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Wed, 2 Apr 2025 11:01:04 +0200 Subject: [PATCH] =?UTF-8?q?In=20HeadCut=20e=20Split,=20si=20aggiungono=20t?= =?UTF-8?q?agli=20extra=20orizzontali=20solo=20se=20il=20materiale=20da=20?= =?UTF-8?q?tagliare=20=C3=A8=20meno=20di=20un=20cubetto.=20Altrimenti=20ci?= =?UTF-8?q?=20sarebbe=20collisione.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/ProcessHeadCut.lua | 10 ++++++---- LuaLibs/ProcessSplit.lua | 5 ++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/LuaLibs/ProcessHeadCut.lua b/LuaLibs/ProcessHeadCut.lua index 1937769..be5a112 100644 --- a/LuaLibs/ProcessHeadCut.lua +++ b/LuaLibs/ProcessHeadCut.lua @@ -406,6 +406,9 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut dSawThick2 = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dSawThick2 end end + -- determino se lo spessore del materiale da rimuovere è eccessivo e quindi vanno fatti più tagli con offset + local nCuts = max( ceil( dOvmHead / (( BD.MAX_LEN_SCRAP_START or BD.MAX_LEN_SCRAP) + 0.5)), 1) + local dOffsL = dOvmHead / nCuts -- caratteristiche taglio local dDimYRef = EgtIf( b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL, dMaxDepth, abs( BD.MAX_DIM_HTCUT_HBEAM)) local bBigSectionCut = ( b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) and @@ -417,7 +420,9 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut -- verifico necessità di tagli aggiuntivi orizzontali o verticali local dMinOvmHeadForAddeddCuts = 10.123 local bNeedVerticalAddedCuts = ( Proc.Face[1].WidthTrimmed > BD.MAX_LEN_DICE) and ( dOvmHead > dMinOvmHeadForAddeddCuts - 10 * GEO.EPS_SMALL) - local bNeedHorizontalAddedCuts = ( Proc.Face[1].HeightTrimmed > ( BD.MIN_HEIGHT_ADDED_CUTS or BD.MAX_LEN_DICE)) and not bBigSectionCut and ( dOvmHead > dMinOvmHeadForAddeddCuts - 10 * GEO.EPS_SMALL) + local bNeedHorizontalAddedCuts = ( Proc.Face[1].HeightTrimmed > ( BD.MIN_HEIGHT_ADDED_CUTS or BD.MAX_LEN_DICE)) and + not bBigSectionCut and ( dOvmHead > dMinOvmHeadForAddeddCuts - 10 * GEO.EPS_SMALL) and + dOffsL < BD.MAX_DIM_DICE -- dati lavorazioni sopra e sotto local Cutting1Data = { sCutting = sCutting, dSawDiam = dSawDiam, dMaxDepth = dMaxDepth, dSawThick = dSawThick, dMaxVertDepth = dMaxVertDepth} local Cutting2Data = { sCutting = sCutting2, dSawDiam = dSawDiam2, dMaxDepth = dMaxDepth2, dSawThick = dSawThick2} @@ -429,9 +434,6 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut if not bNeedHCut and AreSameVectorApprox( vtN, X_AX()) and abs( ptC:getX() - b3Raw:getMax():getX()) < 10 * GEO.EPS_SMALL then return true end - -- determino se lo spessore del materiale da rimuovere è eccessivo e quindi vanno fatti più tagli con offset - local nCuts = max( ceil( dOvmHead / (( BD.MAX_LEN_SCRAP_START or BD.MAX_LEN_SCRAP) + 0.5)), 1) - local dOffsL = dOvmHead / nCuts -- se taglio per sezioni alte e larghe if bBigSectionCut then if dOvmHead > 0 then diff --git a/LuaLibs/ProcessSplit.lua b/LuaLibs/ProcessSplit.lua index 5c1ad67..b221d5d 100644 --- a/LuaLibs/ProcessSplit.lua +++ b/LuaLibs/ProcessSplit.lua @@ -661,7 +661,10 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt -- determino la necessità di tagli aggiuntivi local dMinTailScrapForAdditionalCuts = 10.123 local bNeedVerticalAddedCuts = not bSplit and ( Proc.Face[1].WidthTrimmed > BD.MAX_LEN_DICE) and ( dLenEndRaw > dMinTailScrapForAdditionalCuts - 10 * GEO.EPS_SMALL) - local bNeedHorizontalAddedCuts = not bSplit and ( Proc.Face[1].HeightTrimmed > ( BD.MIN_HEIGHT_ADDED_CUTS or BD.MAX_LEN_DICE)) and not bBigSectionCut and ( dLenEndRaw > dMinTailScrapForAdditionalCuts - 10 * GEO.EPS_SMALL) + local bNeedHorizontalAddedCuts = not bSplit and not bBigSectionCut and + ( Proc.Face[1].HeightTrimmed > ( BD.MIN_HEIGHT_ADDED_CUTS or BD.MAX_LEN_DICE)) and + ( dLenEndRaw > dMinTailScrapForAdditionalCuts - 10 * GEO.EPS_SMALL) and + dOffsL < BD.MAX_DIM_DICE -- dati lavorazioni sopra e sotto local Cutting1Data = { sCutting = sCutting, dSawDiam = dSawDiam, dMaxDepth = dSawMaxDepth, dSawThick = dSawThick, dMaxVertDepth = dMaxVertDepth} local Cutting2Data = { sCutting = sCutting2, dSawDiam = dSawDiam2, dMaxDepth = dSawMaxDepth2, dSawThick = dSawThick2}