From e44f5fae570cc2cdc29c6bff10c2ca0f036bb7bd Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Sun, 25 May 2025 21:44:05 +0200 Subject: [PATCH] DataDoors 2.7e4 : - altre modifiche per decoro Krepa di DoorArreda (comportamento speciale controllato da info nel file del disegno della decorazione). --- LuaLibs/ImportNgeFile.lua | 5 +++++ Main.lua | 26 +++++++++++++++++++++++++- Version.lua | 4 ++-- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/LuaLibs/ImportNgeFile.lua b/LuaLibs/ImportNgeFile.lua index 56de604..85069eb 100644 --- a/LuaLibs/ImportNgeFile.lua +++ b/LuaLibs/ImportNgeFile.lua @@ -107,6 +107,11 @@ function ImportNgeFile.Draw( CustGeomPath, CustGeomFile ) if sMirr then EgtSetInfo( Lg, 'Mirror', sMirr) end + -- recupero eventuale flag di rotazione (positivo verso le cerniere) + local sRot = EgtGetInfo( nNewLayer, 'Rotate') + if sRot then + EgtSetInfo( Lg, 'Rotate', sRot) + end -- riloco tutti i nuovi layer dal nuovo pezzo al pezzo corrente while nNewLayer do diff --git a/Main.lua b/Main.lua index 1563cc4..1ef755f 100644 --- a/Main.lua +++ b/Main.lua @@ -1,4 +1,4 @@ --- Main.lua by EgalWare s.r.l. 2025.05.06 +-- Main.lua by EgalWare s.r.l. 2025.05.26 -- Main creazione porte da descrizione DDF -- 2016.09.07 V1.001 FM Modificata gestione flush bolt -- 2016.09.14 V1.002 FM Aggiunta gestione log file @@ -6281,8 +6281,32 @@ local function MoveGeomDecoration( nGeomId, sFace, sSideLk) local dZedPos = 0 local bMirror = ( EgtGetInfo( nGeomId, 'Mirror', 'i') ~= 0) + local dRotToHinges = EgtGetInfo( nGeomId, 'Rotate', 'd') local b3Box = EgtGetBBox( nGeomId, GDB_BB.STANDARD) + EgtOutLog( 'Decoration Box 1 ='.. tostring( b3Box)) + -- sistemo per eventuale rotazione + if not bMirror and abs( dRotToHinges) > GEO.EPS_ANG_SMALL then + -- eseguo rotazione + local dAngRot = EgtIf( sSideLk == 'L', -dRotToHinges, dRotToHinges) + if string.lower( sFace) == 'secure' then dAngRot = -dAngRot end + local nNewEnt = EgtGetFirstInGroup( nGeomId) + while nNewEnt do + EgtRotate( nNewEnt, b3Box:getCenter(), Z_AX(), dAngRot) + nNewEnt = EgtGetNext( nNewEnt) + end + local b3NewBox = EgtGetBBox( nGeomId, GDB_BB.STANDARD) + -- riporto in posizione + local vtMove = b3Box:getMin() - b3NewBox:getMin() + nNewEnt = EgtGetFirstInGroup( nGeomId) + while nNewEnt do + EgtMove( nNewEnt, vtMove) + nNewEnt = EgtGetNext( nNewEnt) + end + -- aggiorno box + b3Box = EgtGetBBox( nGeomId, GDB_BB.STANDARD) + end + EgtOutLog( 'Decoration Box 2 ='.. tostring( b3Box)) if string.lower( sFace) == 'keyway' then -- se specificato face su lato keyway (davanti) dZedPos = DGD.dT diff --git a/Version.lua b/Version.lua index 5f3782b..8ea5e49 100644 --- a/Version.lua +++ b/Version.lua @@ -1,6 +1,6 @@ --- Version.lua by EgalWare s.r.l. 2025/05/14 +-- Version.lua by EgalWare s.r.l. 2025/05/26 -- Gestione della versione di Doors NAME = 'Doors' -VERSION = '2.7e3' +VERSION = '2.7e4' MIN_EXE = '2.6k4'