From e25e804adab9688fa149dcd36ea9533566cdfa2b Mon Sep 17 00:00:00 2001 From: DarioS Date: Mon, 8 Nov 2021 05:45:19 +0100 Subject: [PATCH] DataBeam : - in taglio doppio modificata gestione smusso per testa sopra e sotto (quando presente). --- LuaLibs/ProcessCut.lua | 2 +- LuaLibs/ProcessDoubleCut.lua | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/LuaLibs/ProcessCut.lua b/LuaLibs/ProcessCut.lua index b383c61..0791064 100644 --- a/LuaLibs/ProcessCut.lua +++ b/LuaLibs/ProcessCut.lua @@ -1,4 +1,4 @@ --- ProcessCut.lua by Egaltech s.r.l. 2021/10/06 +-- ProcessCut.lua by Egaltech s.r.l. 2021/11/05 -- Gestione calcolo singoli tagli di lama per Travi -- 2021/05/18 I due tagli con testa da sotto di un cubetto sono fatti di seguito. -- 2021/06/06 Correzioni per tagli con testa da sotto. diff --git a/LuaLibs/ProcessDoubleCut.lua b/LuaLibs/ProcessDoubleCut.lua index 1d28741..671fb36 100644 --- a/LuaLibs/ProcessDoubleCut.lua +++ b/LuaLibs/ProcessDoubleCut.lua @@ -1,4 +1,4 @@ --- ProcessDoubleCut.lua by Egaltech s.r.l. 2021/07/01 +-- ProcessDoubleCut.lua by Egaltech s.r.l. 2021/11/05 -- Gestione calcolo doppi tagli di lama per Travi -- Tabella per definizione modulo @@ -75,14 +75,15 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead) -- recupero i dati della curva e del profilo local dWidth = abs( EgtCurveThickness( AuxId)) local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) - -- eseguo lo smusso solo se direzione orizzontale (non propago la segnalazione a TS3) - if abs( vtExtr:getZ()) > 0.1 then + -- eseguo lo smusso solo se direzione orizzontale o anche testa da sotto (non propago la segnalazione a TS3) + local bVert = ( abs( vtExtr:getZ()) > 0.1) + if bVert and not BD.DOWN_HEAD then local sWarn = 'Warning : skipped not horizontal chamfer' EgtOutLog( sWarn) return true end -- eseguo lo smusso solo se feature larga come la trave - if dWidth < b3Raw:getDimY() - 1 then + if ( not bVert and dWidth < b3Raw:getDimY() - 1) or ( bVert and dWidth < b3Raw:getDimZ() - 1) then local sWarn = 'Warning : skipped chamfer (feature smaller than beam)' EgtOutLog( sWarn) return true, sWarn @@ -91,13 +92,19 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead) -- recupero la lavorazione local sMilling = ML.FindMilling( 'Mark') if not sMilling then - local sErr = 'Error : milling not found in library' + local sErr = 'Error : milling (Mark) not found in library' + EgtOutLog( sErr) + return false, sErr + end + local sMillingDw = ML.FindMilling( 'Mark_H2') + if bVert and not sMillingDw then + local sErr = 'Error : milling (Mark_H2) not found in library' EgtOutLog( sErr) return false, sErr end -- Inserisco la lavorazione del lato standard local sName1 = 'SJN_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) - local nMch1Id = EgtAddMachining( sName1, sMilling) + local nMch1Id = EgtAddMachining( sName1, EgtIf( not bVert or vtExtr:getZ() > 0.1, sMilling, sMillingDw)) if not nMch1Id then local sErr = 'Error adding machining ' .. sName1 .. '-' .. sMilling EgtOutLog( sErr) @@ -118,7 +125,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead) end -- Inserisco la lavorazione del lato opposto local sName2 = 'SJN_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) - local nMch2Id = EgtAddMachining( sName2, sMilling) + local nMch2Id = EgtAddMachining( sName2, EgtIf( not bVert or vtExtr:getZ() < -0.1, sMilling, sMillingDw)) if not nMch2Id then local sErr = 'Error adding machining ' .. sName2 .. '-' .. sMilling EgtOutLog( sErr)