From 919b32ca8def62c27940f8cbda4cbc4199167e30 Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Wed, 12 Nov 2025 15:48:10 +0100 Subject: [PATCH] In ProcessCut, se taglio rivolto verso il basso, si controlla che non sia troppo profondo, cercando di evitare collisione tra pezzo e carro Z --- LuaLibs/ProcessCut.lua | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/LuaLibs/ProcessCut.lua b/LuaLibs/ProcessCut.lua index 1cb7a62..8689717 100644 --- a/LuaLibs/ProcessCut.lua +++ b/LuaLibs/ProcessCut.lua @@ -65,11 +65,14 @@ function ProcessCut.Classify( Proc, b3Raw) end -- recupero i dati del taglio local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT) - if vtN:getZ() <= - 0.5 and abs( vtN:getY()) > 0.1 or ( vtN:getZ() <= - 0.174 and abs( vtN:getY()) > 0.866) then - -- calcolo le massime estensioni lineari orizzontale e verticale della faccia - local _, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, 0, b3Raw) + -- calcolo le massime estensioni lineari orizzontale e verticale della faccia + local _, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, 0, b3Raw) + if ( vtN:getZ() <= - 0.5 and abs( vtN:getY()) > 0.1) or + ( vtN:getZ() <= - 0.174 and abs( vtN:getY()) > 0.866) or + ( vtN:getZ() <= - 0.174 and abs( vtN:getZ()) * DimV > BD.MAX_DIM_DICE) + then -- confronto queste estensioni con la massima dimensione del DiceCut (impossibile lavorare se entrambe maggiori) - if DimH > BD.MAX_DIM_DICE and DimV > BD.MAX_DIM_DICE then + if DimH > BD.MAX_DIM_DICE + 100 * GEO.EPS_SMALL and DimV > BD.MAX_DIM_DICE + 100 * GEO.EPS_SMALL then return true, true end end @@ -90,7 +93,7 @@ function ProcessCut.Classify( Proc, b3Raw) end end -- calcolo l'ingombro orizzontale della faccia - local _, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, 0) + _, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, 0) -- confronto questo ingombro con il doppio della massima dimensione del DiceCut (impossibile lavorare sotto da sopra se più di 2 tagli oppure se tipo PF, taglio inclinato in Y e non taglio singolo orizzontale) if DimH > 2 * BD.MAX_DIM_DICE or ( BD.C_SIMM and ( abs( vtN:getY()) > 0.1) and dMaxMat < DimH + BD.CUT_EXTRA) then return true, true