diff --git a/LuaLibs/BeamLib.lua b/LuaLibs/BeamLib.lua index 6e57f1f..e1002ee 100644 --- a/LuaLibs/BeamLib.lua +++ b/LuaLibs/BeamLib.lua @@ -189,12 +189,20 @@ function BeamLib.InvertRawPart( Part, nNumberOfRotations) if nNumberOfRotations == 0 then return 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) - + -- box del solido + local b3BoxPart = EgtGetBBoxGlob( EgtGetFirstNameInGroup( Part.id or GDB_ID.NULL, 'Box') or GDB_ID.NULL, GDB_BB.EXACT) + -- box esatto del pezzo + local b3BoxExact = EgtGetBBoxGlob( Part.id or GDB_ID.NULL, GDB_BB.EXACT) + -- rotazione + local dAngRot = nNumberOfRotations * 90 + EgtRotatePartInRawPart( Part.id, Z_AX(), dAngRot) + -- correggo per eccentricità solido rispetto a geometria complessiva del pezzo + local vtEccOri = b3BoxPart:getCenter() - b3BoxExact:getCenter() + local vtEccRot = Vector3d( vtEccOri) + vtEccRot:rotate( Z_AX(), dAngRot) + EgtMovePartInRawPart( Part.id, ( vtEccOri - vtEccRot)) end + ------------------------------------------------------------------------------------------------------------- --- funzione che ruota il grezzo function BeamLib.RotateRawPart( Part, nNumberOfRotations) diff --git a/Process.lua b/Process.lua index f13ecb2..79fad63 100644 --- a/Process.lua +++ b/Process.lua @@ -7,7 +7,7 @@ -- Intestazioni require( 'EgtBase') _ENV = EgtProtectGlobal() -EgtEnableDebug( false) +EgtEnableDebug( true) -- Imposto direttorio libreria specializzata per Travi EgtAddToPackagePath( BEAM.BASEDIR .. '\\LuaLibs\\?.lua')