- Corrette rotazioni pezzo durante le varie fasi di calcolo
- Prima versione tagli testa/split in fase corretta
This commit is contained in:
+7
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user