From e67e397225e06d7282bc4b543932f1a64555e3b5 Mon Sep 17 00:00:00 2001 From: DarioS Date: Thu, 18 Aug 2022 15:11:21 +0200 Subject: [PATCH 1/2] DataBeam : - modiciche a taglio di testa e taglio di separazione per macchine con testa da sotto con lama disabilitata - modiciche a forature per macchine con testa da sotto con puntaa disabilitata. --- LuaLibs/BeamExec.lua | 16 ++++++++++++++-- LuaLibs/ProcessDrill.lua | 15 +++++++++------ LuaLibs/ProcessHeadCut.lua | 30 ++++++++++++++++-------------- LuaLibs/ProcessSplit.lua | 30 ++++++++++++++++-------------- 4 files changed, 55 insertions(+), 36 deletions(-) diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index 088f5b0..115e329 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -1,4 +1,4 @@ --- BeamExec.lua by Egaltech s.r.l. 2022/08/08 +-- BeamExec.lua by Egaltech s.r.l. 2022/08/18 -- Libreria esecuzione lavorazioni per Travi -- 2019/07/11 Aggiunta gestione stato rotazione di feature per TS3. -- 2019/09/04 Corretto controllo feature di testa e coda con sovramateriale di testa elevato. @@ -34,6 +34,7 @@ -- controllata tramite il parametro IMPROVE_HEAD_TAIL_DRILLINGS da BeamData. Attivata di default. -- 2022/08/01 Tolleranza su sezione portata a 0.1 mm (100 * GEO.EPS_SMALL). -- 2022/08/08 Modifica per macchine senza BD.MAX_WIDTH2 e BD.MAX_HEIGHT2. +-- 2022/08/18 Aggiunta gestione macchine con testa da sotto con lama da sotto disabilitata. -- Tabella per definizione modulo local BeamExec = {} @@ -391,6 +392,7 @@ end -- *** Inserimento delle travi nel grezzo *** ------------------------------------------------------------------------------------------------------------- local function VerifyBigSectionCut( dRawW, dRawH) + -- lama principale local sCutting = ML.FindCutting( 'TailSide') local dMaxDepth = 50 if EgtMdbSetCurrMachining( sCutting or '') then @@ -400,9 +402,19 @@ local function VerifyBigSectionCut( dRawW, dRawH) end end local dMaxVertDepth = dMaxDepth - ( BD.DECR_VERT_CUT or 0) + -- eventuale lama su testa sotto + local sCutting2 = ML.FindCutting( 'TailSide_H2', false, true) + local dMaxDepth2 = 0 + if sCutting2 and EgtMdbSetCurrMachining( sCutting2) then + local sTuuid2 = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) + if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid2) or '') then + dMaxDepth2 = EgtTdbGetCurrToolMaxDepth() or dMaxDepth2 + end + end + -- verifiche local dDimYRef = EgtIf( dRawH < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL, dMaxDepth, abs( BD.MAX_DIM_HTCUT_HBEAM)) local bBigSectionCut = ( dRawW > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) and - ( dRawH > EgtIf( BD.DOWN_HEAD or BD.TURN, 2, 1) * dMaxVertDepth - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) + ( dRawH > EgtIf( BD.TURN, 2 * dMaxVertDepth, dMaxVertDepth + dMaxDepth2) - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) return bBigSectionCut end diff --git a/LuaLibs/ProcessDrill.lua b/LuaLibs/ProcessDrill.lua index 29a33ce..470c672 100644 --- a/LuaLibs/ProcessDrill.lua +++ b/LuaLibs/ProcessDrill.lua @@ -1,4 +1,4 @@ --- ProcessDrill.lua by Egaltech s.r.l. 2022/04/21 +-- ProcessDrill.lua by Egaltech s.r.l. 2022/08/18 -- Gestione calcolo forature per Travi -- 2021/04/14 DS Corretta gestione Invert con testa da sotto. Migliorato calcolo ingombro portautensile. -- 2021/05/03 DS Su macchina con testa da sotto aggiunta possibilità di fare fori verticali metà sopra e l'altra sotto. @@ -12,6 +12,7 @@ -- 2022/07/07 Aggiunta la gestione delle forature migliorate in presenza di feature testa/coda che tagliano tutta la sezione; gli Id delle feature sono nelle proprietà MachineAfterHeadCutId e MachineAfterTailCutId. -- 2022/07/12 Aggiunto un valore minimo (10) per la distanza di sicurezza. -- 2022/07/27 Aggiunta la gestione del tipo di foratura "AngleDrill" per fori molto inclinati +-- 2022/08/18 Aggiunta gestione macchine con testa da sotto e punta disabilitata. -- Tabella per definizione modulo local ProcessDrill = {} @@ -231,15 +232,17 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) vtExtr = - vtExtr end local bOpen = ( Proc.Fcs ~= 0 and Proc.Fce ~= 0) + -- verifico possibilità di foratura da sotto + local bDownDrill = ( BD.DOWN_HEAD and ML.FindDrilling( dDiam, nil, false, true)) -- verifico che il foro non sia fattibile solo da sotto - local bToInvert = ( vtExtr:getZ() < BD.DRILL_VZ_MIN and not BD.DOWN_HEAD) + local bToInvert = ( vtExtr:getZ() < BD.DRILL_VZ_MIN and not bDownDrill) if bToInvert and ( not bOpen or Proc.Flg ~= 1) then local sErr = 'Error : drilling from bottom impossible' EgtOutLog( sErr) return false, sErr end -- se non già richiesta inversione e invertibile - if not bToInvert and Proc.Flg == 1 and ( -vtExtr:getZ() >= BD.DRILL_VZ_MIN or BD.DOWN_HEAD) then + if not bToInvert and Proc.Flg == 1 and ( -vtExtr:getZ() >= BD.DRILL_VZ_MIN or bDownDrill) then -- se il foro è cieco o troppo inclinato all'inizio, lo inverto local _, CosB, _ = GetHoleStartData( ptCen, vtExtr, b3Solid) if Proc.Fcs == 0 or ( CosB > BD.DRILL_VX_MAX and bOpen) then @@ -262,8 +265,8 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) local dCheckDepth2 = dDepth2 local nErrorCode = 0 -- abilitazione foratura da sotto - local bDrillDown = ( BD.DOWN_HEAD and ( Proc.Down or vtExtr:getZ() < -0.1 or vtExtr:getZ() < 0.259)) - local bDrillUp = ( BD.DOWN_HEAD and vtExtr:getZ() > -0.5) + local bDrillDown = ( bDownDrill and ( Proc.Down or vtExtr:getZ() < -0.1 or vtExtr:getZ() < 0.259)) + local bDrillUp = ( bDownDrill and vtExtr:getZ() > -0.5) -- primo gruppo di controlli con lunghezza utensile pari a metà foro se passante -- recupero la lavorazione local sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth, bDrillUp, bDrillDown) @@ -479,7 +482,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes) -- eseguo local bOk = ML.ApplyMachining( true, false) - if not bOk and BD.DOWN_HEAD then + if not bOk and bDownDrill then if sType == 'Drill' or sType == 'Drill_H2' or sType == 'AngleDrill' then EgtSetMachiningParam( MCH_MP.INVERT, true) else diff --git a/LuaLibs/ProcessHeadCut.lua b/LuaLibs/ProcessHeadCut.lua index 966c6ed..483864c 100644 --- a/LuaLibs/ProcessHeadCut.lua +++ b/LuaLibs/ProcessHeadCut.lua @@ -1,7 +1,8 @@ --- ProcessSplit.lua by Egaltech s.r.l. 2022/07/25 +-- ProcessSplit.lua by Egaltech s.r.l. 2022/08/18 -- Gestione calcolo tagli di testa per Travi -- 2022/05/31 Aggiunta gestione sezioni alte e larghe con taglio di tipo diceCut. -- 2022/06/10 Per sezioni alte e larghe aggiunta gestione finitura in base a sovramateriale e a parametro Q05 dell' eventuale lavorazione sostituita. +-- 2022/08/18 Aggiunta gestione macchine con testa da sotto con lama da sotto disabilitata. -- Tabella per definizione modulo local ProcessHeadCut = {} @@ -173,10 +174,22 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut end end local dMaxVertDepth = dMaxDepth - ( BD.DECR_VERT_CUT or 0) + -- recupero la eventuale lavorazione con lama da sotto + local sCutting2 = ML.FindCutting( 'HeadSide_H2', false, true) + -- recupero i dati della eventuale seconda lama + local dSawDiam2 = 0 + local dMaxDepth2 = 0 + if sCutting2 and EgtMdbSetCurrMachining( sCutting2) then + local sTuuid2 = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) + if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid2) or '') then + dSawDiam2 = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam2 + dMaxDepth2 = EgtTdbGetCurrToolMaxDepth() or dMaxDepth2 + end + end -- 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 - ( b3Raw:getDimZ() > EgtIf( BD.DOWN_HEAD or BD.TURN, 2, 1) * dMaxVertDepth - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) + ( b3Raw:getDimZ() > EgtIf( BD.TURN, 2 * dMaxVertDepth, dMaxVertDepth + dMaxDepth2) - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) local bHorizCut = ( not bBigSectionCut and ( b3Raw:getDimY() > b3Raw:getDimZ() + 10 * GEO.EPS_SMALL or BD.TURN) and b3Raw:getDimZ() < dMaxVertDepth - BD.CUT_EXTRA) local bDoubleHorizCut = ( ( BD.DOWN_HEAD or BD.TURN) and not bBigSectionCut and not bHorizCut and b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) local bDoubleCut = ( not bBigSectionCut and not bHorizCut and not bDoubleHorizCut and b3Raw:getDimY() > dDimYRef - BD.CUT_EXTRA + 10 * GEO.EPS_SMALL) @@ -250,23 +263,12 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut end -- altrimenti necessari tagli da sopra e sotto con testa opportuna else - -- recupero la lavorazione con lama da sotto - local sCutting2 = ML.FindCutting( 'HeadSide_H2', false, true) + -- verifico esistenza della lavorazione con lama da sotto if not sCutting2 then local sErr = 'Error : cutting H2 not found in library' EgtOutLog( sErr) return false, sErr end - -- recupero i dati della seconda lama - local dSawDiam2 = 400 - local dMaxDepth2 = 50 - if EgtMdbSetCurrMachining( sCutting2) then - local sTuuid2 = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) - if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid2) or '') then - dSawDiam2 = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam2 - dMaxDepth2 = EgtTdbGetCurrToolMaxDepth() or dMaxDepth2 - end - end -- verifico che le due lame riescano a lavorare la sezione local dDimZ = b3Raw:getDimZ() local dExtra = dMaxVertDepth + dMaxDepth2 - dDimZ diff --git a/LuaLibs/ProcessSplit.lua b/LuaLibs/ProcessSplit.lua index 5683299..8562f4a 100644 --- a/LuaLibs/ProcessSplit.lua +++ b/LuaLibs/ProcessSplit.lua @@ -1,7 +1,8 @@ --- ProcessSplit.lua by Egaltech s.r.l. 2022/07/26 +-- ProcessSplit.lua by Egaltech s.r.l. 2022/08/18 -- Gestione calcolo tagli di separazione per Travi -- 2022/05/31 Aggiunta gestione sezioni alte e larghe con taglio con sega a catena seguito da rifinitura con lama (aggiunta funzione MakeSplitByChainSaw); gestione eventuale creazione nuova fase dall'interno della Make. -- 2022/06/10 Per sezioni alte e larghe aggiunta gestione finitura in base a sovramateriale e a parametro Q05 dell' eventuale lavorazione sostituita. +-- 2022/08/18 Aggiunta gestione macchine con testa da sotto con lama da sotto disabilitata. -- Tabella per definizione modulo local ProcessSplit = {} @@ -261,10 +262,22 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt end end local dMaxVertDepth = dMaxDepth - ( BD.DECR_VERT_CUT or 0) + -- recupero la eventuale lavorazione con lama da sotto + local sCutting2 = ML.FindCutting( 'TailSide_H2', false, true) + -- recupero i dati della eventuale seconda lama + local dSawDiam2 = 0 + local dMaxDepth2 = 0 + if sCutting2 and EgtMdbSetCurrMachining( sCutting2) then + local sTuuid2 = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) + if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid2) or '') then + dSawDiam2 = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam2 + dMaxDepth2 = EgtTdbGetCurrToolMaxDepth() or dMaxDepth2 + end + end -- 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 - ( b3Raw:getDimZ() > EgtIf( BD.DOWN_HEAD or BD.TURN, 2, 1) * dMaxVertDepth - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) + ( b3Raw:getDimZ() > EgtIf( BD.TURN, 2 * dMaxVertDepth, dMaxVertDepth + dMaxDepth2) - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) local bHorizCut = ( not bBigSectionCut and ( b3Raw:getDimY() > b3Raw:getDimZ() + 10 * GEO.EPS_SMALL or BD.TURN) and ( b3Raw:getDimZ() < dMaxVertDepth - BD.CUT_EXTRA)) local bDoubleHorizCut = ( ( BD.DOWN_HEAD or BD.TURN) and not bBigSectionCut and not bHorizCut and b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) local bDoubleCut = ( not bBigSectionCut and not bHorizCut and not bDoubleHorizCut and b3Raw:getDimY() > dDimYRef - BD.CUT_EXTRA + 10 * GEO.EPS_SMALL) @@ -433,23 +446,12 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt end -- altrimenti necessari tagli da sopra e sotto con testa opportuna else - -- recupero la lavorazione con lama da sotto - local sCutting2 = ML.FindCutting( 'TailSide_H2', false, true) + -- verifico esistenza della lavorazione con lama da sotto if not sCutting2 then local sErr = 'Error : cutting H2 not found in library' EgtOutLog( sErr) return false, sErr end - -- recupero i dati della seconda lama - local dSawDiam2 = 400 - local dMaxDepth2 = 50 - if EgtMdbSetCurrMachining( sCutting2) then - local sTuuid2 = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) - if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid2) or '') then - dSawDiam2 = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam2 - dMaxDepth2 = EgtTdbGetCurrToolMaxDepth() or dMaxDepth2 - end - end -- verifico che le due lame riescano a lavorare la sezione local dDimZ = b3Raw:getDimZ() local dExtra = dMaxVertDepth + dMaxDepth2 - dDimZ From 7497b62dee8d6e48bf01a4ddddd1736c47414beb Mon Sep 17 00:00:00 2001 From: DarioS Date: Thu, 18 Aug 2022 19:38:00 +0200 Subject: [PATCH 2/2] DataBeam : - in mortase a coda di rondine migliorato calcolo step tra passate. --- LuaLibs/ProcessDtMortise.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/LuaLibs/ProcessDtMortise.lua b/LuaLibs/ProcessDtMortise.lua index dbe711d..def01c1 100644 --- a/LuaLibs/ProcessDtMortise.lua +++ b/LuaLibs/ProcessDtMortise.lua @@ -1,4 +1,4 @@ --- ProcessDtMortise.lua by Egaltech s.r.l. 2022/06/07 +-- ProcessDtMortise.lua by Egaltech s.r.l. 2022/08/18 -- Gestione calcolo mortase a coda di rondine per Travi -- 2021/04/08 Aggiunto controllo massimo materiale lavorabile dalla fresa. -- 2021/04/08 Miglioria scelta lavorazione in presenza di testa da sotto. @@ -6,6 +6,7 @@ -- 2021/07/20 Aggiunta gestione rinvio angolare su FAST. -- 2021/12/01 Se frontale aggiungo taglio con Grp e Proc di vero taglio (per aggiornare ingombro di testa /coda). -- 2022/06/01 Modifiche per evitare di entrare nel legno con mortase parziali. +-- 2022/08/18 Migliorato calcolo dello step. -- Tabella per definizione modulo local ProcessDtMortise = {} @@ -430,7 +431,8 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) local dDist = min( vtOrtDiff:len(), dWidthMrt) -- calcolo le passate local nPass = ceil( dDist / ( 1.9 * dToolDiam)) - local dStep = ( dDist - 0.95 * dToolDiam) / ( 2 * nPass) + local dStep = 0 + if nPass > 1 then dStep = max( ( dDist - 2 * dToolDiam) / ( 2 * nPass - 2), 0.25 * dToolDiam) end for i = nPass, 1, -1 do -- inserisco la lavorazione di contornatura local sNameF = 'DtMt_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( nPass)