From 08397ae1027a8b59e1ef25f303229763cb24111f Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Mon, 18 May 2026 18:28:57 +0200 Subject: [PATCH] - in NestProcess aggiunte eventuali rotazioni/inversioni duplo nella barra --- NestProcess.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/NestProcess.lua b/NestProcess.lua index 81b18a4..ef7b856 100644 --- a/NestProcess.lua +++ b/NestProcess.lua @@ -8,6 +8,7 @@ EgtEnableDebug( false) -- Include local BeamData = require( 'BeamDataNew') +local BeamLib = require( 'BeamLib') -- Imposto direttorio libreria specializzata per Travi EgtAddToPackagePath( NEST.BASEDIR .. '\\LuaLibs\\?.lua') @@ -594,12 +595,25 @@ for i = 1, #RawInventory.ActiveBeams do local nIndex = 1 for j = #Beam.NestedParts, 1, -1 do local Part = Beam.NestedParts[j] + local nInitialPosition = EgtGetInfo( Part.id, 'INITIALPOSITION', 'i') -- spostamento verso la testa della barra local dPosX = Part.dPosX - Beam.dResidualLength + dStartOffset -- 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) + end -- assegnazione info EgtSetInfo( idMachGroup, "PART" .. nIndex, idDuplo .. "," .. dPosX)