- Corrette rotazioni pezzo durante le varie fasi di calcolo

- Prima versione tagli testa/split in fase corretta
This commit is contained in:
andrea.villa
2025-03-06 17:31:56 +01:00
parent ac4b2ff262
commit 2c410008fd
3 changed files with 152 additions and 63 deletions
+7 -3
View File
@@ -144,11 +144,15 @@ end
-------------------------------------------------------------------------------------------------------------
--- funzione che ruota il pezzo, da lanciare per creare la disposizione corretta
function BeamLib.RotatePart( Part, nNumberOfRotations)
-- sistemo numero rotazioni in caso sia negativa
if nNumberOfRotations < 0 then
nNumberOfRotations = nNumberOfRotations + 4
end
-- primo posizionamento
if nNumberOfRotations == 0 then
; -- il pezzo è già in posizione
-- rotazione 90°
elseif abs( nNumberOfRotations) == 1 then
elseif nNumberOfRotations == 1 then
local dDeltaYZ = EgtGetRawPartBBox( Part.idRaw):getDimY() - EgtGetRawPartBBox( Part.idRaw):getDimZ()
local vtMove = Vector3d( 0, dDeltaYZ / 2 * EgtIf( BeamData.RIGHT_LOAD, -1, 1), dDeltaYZ / 2)
local bPreMove = dDeltaYZ < 0
@@ -161,7 +165,7 @@ function BeamLib.RotatePart( Part, nNumberOfRotations)
nRId = EgtGetNextRawPart( nRId)
end
-- rotazione 180°
elseif abs( nNumberOfRotations) == 2 then
elseif nNumberOfRotations == 2 then
-- ribalto le travi della fase corrente
local nRId = Part.idRaw
while nRId do
@@ -169,7 +173,7 @@ function BeamLib.RotatePart( Part, nNumberOfRotations)
nRId = EgtGetNextRawPart( nRId)
end
-- rotazione 270°
elseif abs( nNumberOfRotations) == 3 then
elseif nNumberOfRotations == 3 then
local dDeltaYZ = EgtGetRawPartBBox( Part.idRaw):getDimY() - EgtGetRawPartBBox( Part.idRaw):getDimZ()
local vtMove = Vector3d( 0, dDeltaYZ / 2 * EgtIf( BeamData.RIGHT_LOAD, -1, 1), dDeltaYZ / 2)
local bPreMove = dDeltaYZ < 0