From 4c5f620117f17f0b7b2fa2e17eabd93d1f26804d Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Fri, 11 Jul 2025 12:20:30 +0200 Subject: [PATCH 1/2] Dopo inversione pezzo si ricalcola il box del pezzo --- LuaLibs/BeamExec.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index 1e0d05c..0d0967f 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -374,7 +374,7 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, PARTS, b local dPosY = EgtIf( BeamData.CENTER_BEAM, ( b3Tab:getDimY() + dRawW * EgtIf( BeamData.RIGHT_LOAD, -1, 1)) / 2, EgtIf( BeamData.RIGHT_LOAD, 0, b3Tab:getDimY())) BeamData.ptOriXR = Point3d( b3Tab:getDimX(), dPosY, 0) BeamData.dPosXR = EgtIf( BeamData.RIGHT_LOAD, MCH_CR.BR, MCH_CR.TR) - + -- Impostazione dell'attrezzaggio di default EgtImportSetup() @@ -1196,7 +1196,9 @@ function BeamExec.GetProcessings( PARTS, bCalcBestPieceUnloadPosition) if bCalcBestPieceUnloadPosition then -- inversione pezzo testa-coda BeamLib.InvertRawPart( PARTS[nPart], 2) - -- TODO in caso di parallelepipedo rettangolare, non serve ricalcolare il box. Se grezzo sagomato potrebbe essere necessario. Da verificare. + -- aggiorno info pezzo + PARTS[nPart].b3Raw = EgtGetRawPartBBox( PARTS[nPart].idRaw) + PARTS[nPart].b3Part = EgtGetBBoxGlob( EgtGetFirstNameInGroup( PARTS[nPart].id, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD) end end local Part = {} @@ -1466,6 +1468,9 @@ function BeamExec.GetCombinationMatrix( PARTS, bCalcBestPieceUnloadPosition) if bCalcBestPieceUnloadPosition then -- inversione del pezzo testa-coda BeamLib.InvertRawPart( PARTS[nPart], 2) + -- aggiorno info pezzo + PARTS[nPart].b3Raw = EgtGetRawPartBBox( PARTS[nPart].idRaw) + PARTS[nPart].b3Part = EgtGetBBoxGlob( EgtGetFirstNameInGroup( PARTS[nPart].id, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD) end end end From 8585797cc08b2be705691b9e8793d1b08e3d1b43 Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Fri, 11 Jul 2025 14:04:32 +0200 Subject: [PATCH 2/2] =?UTF-8?q?PROVVISORIO:=20rotazione=20rawpart=20anzich?= =?UTF-8?q?=C3=A9=20del=20pezzo.=20Da=20correggere=20non=20appena=20sistem?= =?UTF-8?q?ata=20funzione=20di=20rotazione=20pezzo=20nel=20grezzo.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/BeamLib.lua | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/LuaLibs/BeamLib.lua b/LuaLibs/BeamLib.lua index 65a87bb..3aa2905 100644 --- a/LuaLibs/BeamLib.lua +++ b/LuaLibs/BeamLib.lua @@ -190,12 +190,10 @@ function BeamLib.InvertRawPart( Part, nNumberOfRotations) return end - -- si invertono le travi della fase corrente - local nRId = Part.idRaw - while nRId do - EgtRotateRawPart( nRId, Z_AX(), nNumberOfRotations * 90) - nRId = EgtGetNextRawPart( nRId) - end + --TODO รจ giusto ruotare il pezzo all'interno del grezzo, ma sembra non funzionare correttamente. Appena sistemato, cambiare richiamo funzione con questa commentata + --EgtRotatePartInRawPart( Part.id, Z_AX(), nNumberOfRotations * 90) + EgtRotateRawPart( Part.idRaw, Z_AX(), nNumberOfRotations * 90) + end ------------------------------------------------------------------------------------------------------------- --- funzione che ruota il grezzo