From 608f8da033187b0c6ddd2525a09511ad441d8365 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Tue, 19 May 2026 09:50:58 +0200 Subject: [PATCH] - in NestProcess si fanno correttamente inversioni e rotazioni --- NestProcess.lua | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/NestProcess.lua b/NestProcess.lua index ef7b856..0320427 100644 --- a/NestProcess.lua +++ b/NestProcess.lua @@ -160,7 +160,7 @@ function RawInventory:PrintDiagnosticReport() -- Stampa tramite il sistema di logging proprietario EgtLog EgtOutLog("==========================================================") - EgtOutLog(" EGALWARE NESTING ENGINE DIAGNOSTIC ") + EgtOutLog(" NESTING RESULT ") EgtOutLog("==========================================================") EgtOutLog(string.format("Total Parts Demanded : %d", #JobPool)) EgtOutLog(string.format("Parts Successfully Nested: %d", nActualNestedParts)) @@ -173,13 +173,13 @@ function RawInventory:PrintDiagnosticReport() end EgtOutLog(string.format("Total Bars Used : %d", nBeamsUsed)) - EgtOutLog(string.format("Total Material Cut : %.2f mm", dTotalPartLength)) + EgtOutLog(string.format("Total Material Cut : %.2f m", dTotalPartLength / 1000)) EgtOutLog("----------------------------------------------------------") EgtOutLog(string.format("Gross Yield (Rendimento): %.2f%%", dGrossEfficiency)) EgtOutLog(string.format("Net Yield (Riutilizzato): %.2f%%", dNetEfficiency)) EgtOutLog("----------------------------------------------------------") - EgtOutLog(string.format("Total Usable Remnants : %.2f mm (Safe for Clamps)", dTotalUsableRemnants)) - EgtOutLog(string.format("Total Pure Scrap (Sfrido): %.2f mm (Trash Zone)", dTotalScrap)) + EgtOutLog(string.format("Total Usable Remnants : %.2f m (Safe for Clamps)", dTotalUsableRemnants / 1000)) + EgtOutLog(string.format("Total Pure Scrap (Sfrido): %.2f m (Trash Zone)", dTotalScrap / 1000)) EgtOutLog("==========================================================") end @@ -544,7 +544,7 @@ while true do end -- 2 Si provano le barre ancora a stock SOLO SE NON TROVATA SOLUZIONE CON BARRE ATTIVE - -- VirtualBeam si resetta invece di crearne una nuova per velocizzare il calcolo + -- Per velocizzare il calcolo, VirtualBeam si resetta invece di crearne una nuova ogni volta if not BestMove then for i = 1, #RawInventory.Stock do if RawInventory.Stock[i].nCount > 0 then @@ -602,17 +602,22 @@ for i = 1, #RawInventory.ActiveBeams do -- copia del pezzo (aggiunta duplo) local idDuplo = EgtDuploNew( Part.id) - local Duplo = { id = idDuplo, idRaw = EgtGetRawPartFromPart( idDuplo)} - - -- eventuale inversione - if EgtEndsWith( Part.sState, 'INV') then - BeamLib.InvertRawPart( Duplo, 2) - end -- eventuale rotazione if ( EgtStartsWith( Part.sState, '0010') and nInitialPosition == 1) or ( EgtStartsWith( Part.sState, '1000') and nInitialPosition == 3) then - BeamLib.RotateRawPart( Duplo, 2) + local idSurfTmBoxDuplo = EgtGetFirstNameInGroup( idDuplo, "Box") + local b3Duplo = EgtGetBBoxGlob( idSurfTmBoxDuplo, GDB_BB.STANDARD) + EgtRotate( idDuplo, b3Duplo:getCenter(), X_AX(), 180, GDB_RT.GLOB) + EgtSetInfo( idDuplo, 'ROT', 180) + end + + -- eventuale inversione + if EgtEndsWith( Part.sState, 'INV') then + local idSurfTmBoxDuplo = EgtGetFirstNameInGroup( idDuplo, "Box") + local b3Duplo = EgtGetBBoxGlob( idSurfTmBoxDuplo, GDB_BB.STANDARD) + EgtRotate( idDuplo, b3Duplo:getCenter(), Z_AX(), 180, GDB_RT.GLOB) + EgtSetInfo( idDuplo, 'FLIP', 180) end -- assegnazione info