diff --git a/BatchProcess.lua b/BatchProcess.lua index 9aefe5f..c94a6d6 100644 --- a/BatchProcess.lua +++ b/BatchProcess.lua @@ -536,7 +536,7 @@ EgtOutLog( sTime) -- Imposto la vista ISO 3d, se richiesto if BEAM.FLAG == 1 or BEAM.FLAG == 2 then - EgtSetView( SCE_VD.ISO_SW, false) + EgtSetView( EgtIf( BD.RIGHT_LOAD, SCE_VD.ISO_NE, SCE_VD.ISO_SW), false) end -- Completamento senza errori e avvisi diff --git a/BatchProcessNew.lua b/BatchProcessNew.lua index b5578ce..f86fb5f 100644 --- a/BatchProcessNew.lua +++ b/BatchProcessNew.lua @@ -204,8 +204,9 @@ if bToProcess then EgtSetCurrMachGroup() -- Area tavola local b3Tab = EgtGetTableArea() - -- Calcolo posizione estremo TR della tavola rispetto a sua origine in BL - BD.OriTR = Point3d( b3Tab:getDimX(), b3Tab:getDimY(), 0) + -- Calcolo posizione estremo TR o BR della tavola rispetto a sua origine in BL + BD.OriXR = Point3d( b3Tab:getDimX(), EgtIf( BD.RIGHT_LOAD, 0, b3Tab:getDimY()), 0) + BD.PosXR = EgtIf( BD.RIGHT_LOAD, MCH_CR.BR, MCH_CR.TR) -- Calcolo minimo grezzo scaricabile local nRawId = EgtGetFirstRawPart() if not nRawId then @@ -628,7 +629,7 @@ EgtOutLog( sTime) -- Imposto la vista ISO 3d, se richiesto if BEAM.FLAG == 1 or BEAM.FLAG == 2 then - EgtSetView( SCE_VD.ISO_SW, false) + EgtSetView( EgtIf( BD.RIGHT_LOAD, SCE_VD.ISO_NE, SCE_VD.ISO_SW), false) end -- Completamento senza errori e avvisi diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index 8936c44..650f67f 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -1,4 +1,4 @@ --- BeamExec.lua by Egaltech s.r.l. 2021/03/25 +-- BeamExec.lua by Egaltech s.r.l. 2021/07/13 -- 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. @@ -21,6 +21,7 @@ -- 2020/10/23 Corretto spostamento foro per tenone quando tenone nullo. -- 2020/12/29 Aggiunta gestione fori in doppio. -- 2021/02/25 Aggiunta gestione eventuale ricalcolo per macchine tipo PF. +-- 2021/07/13 Aggiunta gestione posizionamento pezzo TR/BR per macchine con carico a destra e scarico a sinistra. -- Tabella per definizione modulo local BeamExec = {} @@ -140,9 +141,10 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, vBeam, bMachGroup -- Area tavola local b3Tab = EgtGetTableArea() - -- Calcolo posizione estremo TR della tavola rispetto a sua origine in BL - BD.OriTR = Point3d( b3Tab:getDimX(), b3Tab:getDimY(), 0) - + -- Calcolo posizione estremo TR/BR della tavola rispetto a sua origine in BL + BD.OriXR = Point3d( b3Tab:getDimX(), EgtIf( BD.RIGHT_LOAD, 0, b3Tab:getDimY()), 0) + BD.PosXR = EgtIf( BD.RIGHT_LOAD, MCH_CR.BR, MCH_CR.TR) + -- Impostazione dell'attrezzaggio di default EgtImportSetup() @@ -177,7 +179,7 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, vBeam, bMachGroup local Delta = CrawLen - PartLen - DeltaS -- creo e posiziono il grezzo local nRaw = EgtAddRawPart( Point3d(0,0,0), CrawLen, dRawW, dRawH, BD.RAWCOL) - EgtMoveToCornerRawPart( nRaw, BD.OriTR, MCH_CR.TR) + EgtMoveToCornerRawPart( nRaw, BD.OriXR, BD.PosXR) EgtMoveRawPart( nRaw, Vector3d( Len - dRawL, 0, 0)) -- assegno ordine in lavorazione Cnt = Cnt + 1 @@ -228,7 +230,7 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, vBeam, bMachGroup -- Se rimasto materiale aggiungo grezzo dell'avanzo if Len > 10 then local nRaw = EgtAddRawPart( Point3d(0,0,0), Len, dRawW, dRawH, BD.RAWCOL) - EgtMoveToCornerRawPart( nRaw, BD.OriTR, MCH_CR.TR) + EgtMoveToCornerRawPart( nRaw, BD.OriXR, BD.PosXR) EgtMoveRawPart( nRaw, Vector3d( Len - dRawL, 0, 0)) -- assegno ordine in lavorazione Cnt = Cnt + 1 @@ -1086,7 +1088,7 @@ function BeamExec.ProcessFeatures() if nOrd == 1 then EgtSetCurrPhase( 1) else - BL.AddPhaseWithRawParts( nRawId, BD.OriTR, 0) + BL.AddPhaseWithRawParts( nRawId, BD.OriXR, BD.PosXR, 0) end local nPhase = EgtGetCurrPhase() local nDispId = EgtGetPhaseDisposition( nPhase) @@ -1141,7 +1143,7 @@ function BeamExec.ProcessFeatures() end -- se era taglio di separazione, aggiungo nuova fase if bNewPhase then - BL.AddPhaseWithRawParts( nRawId, BD.OriTR, BD.RAW_OFFSET) + BL.AddPhaseWithRawParts( nRawId, BD.OriXR, BD.PosXR, BD.RAW_OFFSET) EgtRotateRawPart( nRawId, X_AX(), 180) -- se grezzo successivo senza pezzi e finale, va tolto local nNextRawId = EgtGetNextRawPart( nRawId) @@ -1158,11 +1160,11 @@ function BeamExec.ProcessFeatures() end -- se separazione non ancora effettuata, aggiungo nuova fase con le travi in posizione standard if not bSplitRot then - BL.AddPhaseWithRawParts( nRawId, BD.OriTR, 0) + BL.AddPhaseWithRawParts( nRawId, BD.OriXR, BD.PosXR, 0) -- altrimenti else -- aggiungo nuova fase con le travi in posizione standard - BL.AddPhaseWithRawParts( nRawId, BD.OriTR, BD.RAW_OFFSET) + BL.AddPhaseWithRawParts( nRawId, BD.OriXR, BD.PosXR, BD.RAW_OFFSET) -- se grezzo successivo senza pezzi e finale, va tolto local nNextRawId = EgtGetNextRawPart( nRawId) if nNextRawId and EgtGetPartInRawPartCount( nNextRawId) == 0 and EgtGetRawPartBBox( nNextRawId):getDimX() < BD.MinRaw then @@ -1186,7 +1188,7 @@ function BeamExec.ProcessFeatures() local nRId = nRawId while nRId do if bPreMove then EgtMoveRawPart( nRId, vtMove) end - EgtRotateRawPart( nRId, X_AX(), 90) + EgtRotateRawPart( nRId, X_AX(), EgtIf( BD.RIGHT_LOAD, -90, 90)) if not bPreMove then EgtMoveRawPart( nRId, vtMove) end nRId = EgtGetNextRawPart( nRId) end @@ -1209,9 +1211,9 @@ function BeamExec.ProcessFeatures() if bOk then nSideMchOk = nSideMchOk + 1 end -- se era taglio di separazione, aggiungo nuova fase if bNewPhase then - BL.AddPhaseWithRawParts( nRawId, BD.OriTR, BD.RAW_OFFSET) + BL.AddPhaseWithRawParts( nRawId, BD.OriXR, BD.PosXR, BD.RAW_OFFSET) if bPreMove then EgtMoveRawPart( nRawId, vtMove) end - EgtRotateRawPart( nRawId, X_AX(), 90) + EgtRotateRawPart( nRawId, X_AX(), EgtIf( BD.RIGHT_LOAD, -90, 90)) if not bPreMove then EgtMoveRawPart( nRawId, vtMove) end -- se grezzo successivo senza pezzi e finale, va tolto local nNextRawId = EgtGetNextRawPart( nRawId) @@ -1232,10 +1234,10 @@ function BeamExec.ProcessFeatures() end -- se separazione non ancora effettuata, aggiungo nuova fase con le travi in posizione standard if not bSplitRot then - BL.AddPhaseWithRawParts( nRawId, BD.OriTR, 0) + BL.AddPhaseWithRawParts( nRawId, BD.OriXR, BD.PosXR, 0) -- altrimenti else - BL.AddPhaseWithRawParts( nRawId, BD.OriTR, BD.RAW_OFFSET) + BL.AddPhaseWithRawParts( nRawId, BD.OriXR, BD.PosXR, BD.RAW_OFFSET) -- se grezzo successivo senza pezzi e finale, va tolto local nNextRawId = EgtGetNextRawPart( nRawId) if nNextRawId and EgtGetPartInRawPartCount( nNextRawId) == 0 and EgtGetRawPartBBox( nNextRawId):getDimX() < BD.MinRaw then @@ -1263,7 +1265,7 @@ function BeamExec.ProcessFeatures() end -- se era taglio di separazione, aggiungo nuova fase if bNewPhase then - BL.AddPhaseWithRawParts( nRawId, BD.OriTR, BD.RAW_OFFSET) + BL.AddPhaseWithRawParts( nRawId, BD.OriXR, BD.PosXR, BD.RAW_OFFSET) -- se grezzo successivo senza pezzi e finale, va tolto local nNextRawId = EgtGetNextRawPart( nRawId) if nNextRawId and EgtGetPartInRawPartCount( nNextRawId) == 0 and EgtGetRawPartBBox( nNextRawId):getDimX() < BD.MinRaw then diff --git a/LuaLibs/BeamLib.lua b/LuaLibs/BeamLib.lua index e79468c..7ddfdab 100644 --- a/LuaLibs/BeamLib.lua +++ b/LuaLibs/BeamLib.lua @@ -130,13 +130,13 @@ function BeamLib.AddPartEndFace( PartId, b3Solid) end ------------------------------------------------------------------------------------------------------------- -function BeamLib.AddPhaseWithRawParts( nFirstRawId, OriTR, dDeltaSucc) +function BeamLib.AddPhaseWithRawParts( nFirstRawId, OriXR, PosXR, dDeltaSucc) EgtAddPhase() local nRawId = nFirstRawId local dRawMove = 0 while nRawId do EgtKeepRawPart( nRawId) - EgtMoveToCornerRawPart( nRawId, OriTR, MCH_CR.TR) + EgtMoveToCornerRawPart( nRawId, OriXR, PosXR) EgtMoveRawPart( nRawId, Vector3d( - dRawMove, 0, 0)) if dRawMove == 0 then dRawMove = dRawMove + dDeltaSucc end dRawMove = dRawMove + EgtGetRawPartBBox( nRawId):getDimX() diff --git a/LuaLibs/ProcessCut.lua b/LuaLibs/ProcessCut.lua index c0283c7..df66dc9 100644 --- a/LuaLibs/ProcessCut.lua +++ b/LuaLibs/ProcessCut.lua @@ -1,7 +1,8 @@ --- ProcessCut.lua by Egaltech s.r.l. 2021/06/08 +-- ProcessCut.lua by Egaltech s.r.l. 2021/07/14 -- 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. +-- 2021/07/14 Migliorie per tagli con testa da sotto. -- Tabella per definizione modulo local ProcessCut = {} @@ -692,9 +693,10 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, if Proc.CutFront then return true end - -- abilitazione lavorazione da sotto (testa da sotto e direzione normale sotto -20deg) + -- abilitazione lavorazione da sotto (testa da sotto e direzione normale sotto -20deg e sbandato oltre 1deg oppure sezione larga o pezzo corto) local bTopHead = ( BD.DOWN_HEAD and vtN:getZ() > -0.342) - local bDownHead = ( BD.DOWN_HEAD and vtN:getZ() < -0.341 and ( abs( vtN:getY()) > 0.017 or b3Raw:getDimY() > 2 * ( BD.MAX_DIM_HTCUT - BD.CUT_EXTRA_MIN))) + local bDownHead = ( BD.DOWN_HEAD and vtN:getZ() < -0.341 and + ( abs( vtN:getY()) > 0.017 or b3Raw:getDimY() > 2 * ( BD.MAX_DIM_HTCUT - BD.CUT_EXTRA_MIN) or b3Raw:getDimX() < BD.LEN_SHORT_PART)) -- recupero la lavorazione local sCutType = EgtIf( Proc.Head, 'HeadSide', 'TailSide') local sCutting = ML.FindCutting( sCutType .. EgtIf( bDownHead, '_H2', ''))