From 387eda8b4a64c5704f80e2df1a6edf7b10f8d981 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Mon, 8 Jun 2026 11:16:50 +0200 Subject: [PATCH] =?UTF-8?q?-=20in=20BeamExec=20corretta=20ProcessBeams=20p?= =?UTF-8?q?er=20i=20casi=20in=20cui=20dPosX=20non=20=C3=A8=20definito?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/BeamExec.lua | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index 38ca696..2d76427 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -436,8 +436,23 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, PARTS, b local dPartWidth = CurrentPart.b3PartOriginal:getDimY( ) local dPartHeight = CurrentPart.b3PartOriginal:getDimZ( ) + -- --- LOGICA ON-THE-FLY PER dPosX (PEZZO CORRENTE E SUCCESSIVO) --- + -- Se il pezzo corrente non ha coordinata, la calcoliamo come fallback standard + if ( not CurrentPart.dPosX) then + if ( i == 1) then + CurrentPart.dPosX = dOvmHead + else + CurrentPart.dPosX = PARTS[i - 1].dPosX + PARTS[i - 1].b3PartOriginal:getDimX( ) + dOvmMid + end + end + + -- Se il pezzo SUCCESSIVO non ha coordinata, la pre-calcoliamo per il look-ahead + if ( i < #PARTS and not PARTS[i + 1].dPosX) then + PARTS[i + 1].dPosX = CurrentPart.dPosX + dPartLen + dOvmMid + end + local dStartOffset = dNextStartOffset - local dEndOffset = dOvmMid + local dEndOffset = ( i == #PARTS ) and 0 or dOvmMid -- LOGICA LOOK-AHEAD: Analisi del gap reale per la ripartizione specchiata if ( i < #PARTS ) then