From 7a84f2c396194d373f8f39cd73dcf5bd96e01759 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Fri, 30 Jan 2026 10:20:20 +0100 Subject: [PATCH] =?UTF-8?q?-=20in=20PreSimulationLib.GetRestlengthSurfTm?= =?UTF-8?q?=20se=20non=20=C3=A8=20l'ultimo=20pezzo=20si=20aggiunge=20tutta?= =?UTF-8?q?=20la=20barra=20restante=20in=20coda?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/PreSimulationLib.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/LuaLibs/PreSimulationLib.lua b/LuaLibs/PreSimulationLib.lua index d9aad4f..7b43359 100644 --- a/LuaLibs/PreSimulationLib.lua +++ b/LuaLibs/PreSimulationLib.lua @@ -66,20 +66,23 @@ end ------------------------------------------------------------------------------------------------------------- -- costruzione trimesh del grezzo restante in testa o in coda (con leggera sovrapposizione) --- TODO qui se non è l'ultimo pezzo va aggiunta tutta la barra restante in coda?? local function GetRestlengthSurfTm( Part, sRestLengthSideForPreSimulation) -- si costruisce il box in globale local b3RestLength if sRestLengthSideForPreSimulation == 'Head' then local b3PartWithOvermaterial = BeamLib.GetPartBoxWithHeadTailOvermaterial( Part, sRestLengthSideForPreSimulation) - local ptStartRestLength = Point3d( Part.b3Part:getX():getMax(), Part.b3Part:getMax():getY(), Part.b3Part:getMax():getZ()) - local ptEndRestLength = Point3d( b3PartWithOvermaterial:getX():getMax(), Part.b3Part:getMin():getY(), Part.b3Part:getMin():getZ()) + local ptStartRestLength = Point3d( Part.b3Part:getMax():getX(), Part.b3Part:getMax():getY(), Part.b3Part:getMax():getZ()) + local ptEndRestLength = Point3d( b3PartWithOvermaterial:getMax():getX(), Part.b3Part:getMin():getY(), Part.b3Part:getMin():getZ()) b3RestLength = BBox3d( ptStartRestLength, ptEndRestLength) elseif sRestLengthSideForPreSimulation == 'Tail' then local b3PartWithOvermaterial = BeamLib.GetPartBoxWithHeadTailOvermaterial( Part, sRestLengthSideForPreSimulation) - local ptStartRestLength = Point3d( Part.b3Part:getX():getMin(), Part.b3Part:getMax():getY(), Part.b3Part:getMax():getZ()) - local ptEndRestLength = Point3d( b3PartWithOvermaterial:getX():getMin(), Part.b3Part:getMin():getY(), Part.b3Part:getMin():getZ()) + local ptXMin = b3PartWithOvermaterial:getMin():getX() + if not Part.bIsLastPart then + ptXMin = Part.b3Part:getMin():getX() - 2000 + end + local ptStartRestLength = Point3d( Part.b3Part:getMin():getX(), Part.b3Part:getMax():getY(), Part.b3Part:getMax():getZ()) + local ptEndRestLength = Point3d( ptXMin, Part.b3Part:getMin():getY(), Part.b3Part:getMin():getZ()) b3RestLength = BBox3d( ptStartRestLength, ptEndRestLength) -- caso non testato, non dovrebbe mai finire qui (il default che arriva da fuori è Tail) else @@ -310,7 +313,6 @@ local function CheckCollisionPoint( ptToolExitToCheck, vtC, vtHead, PreCollision if not bCheckOnlyRestlength then local idCheckCollisionTm = Part.idBoxTm -- se testa o coda attaccate, si considerano nella collisione - -- TODO qui se non è l'ultimo pezzo va aggiunta tutta la barra restante in coda if bCannotSplitRestLength then local b3CheckCollision = BeamLib.GetPartBoxWithHeadTailOvermaterial( Part, sRestLengthSideForPreSimulation) idCheckCollisionTm = EgtSurfTmBBox( Part.idTempGroup, b3CheckCollision, false, GDB_RT.GLOB)