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)