- Per CalculateStrategies e CalculateMachinings si ribalta pezzo per averlo in posizione corretta nel momento dell'esecuzione della Proc

- Modificata RotatePart. Adesso bisogna passare il numero di rotazioni da fare
This commit is contained in:
andrea.villa
2025-03-03 15:03:18 +01:00
parent 6251c070ee
commit 46cdaa494b
2 changed files with 32 additions and 22 deletions
+5 -5
View File
@@ -143,12 +143,12 @@ end
-------------------------------------------------------------------------------------------------------------
--- funzione che ruota il pezzo, da lanciare per creare la disposizione corretta
function BeamLib.RotatePart( Part, nPosition)
function BeamLib.RotatePart( Part, nNumberOfRotations)
-- primo posizionamento
if nPosition == 1 then
if nNumberOfRotations == 0 then
; -- il pezzo è già in posizione
-- rotazione 90°
elseif nPosition == 2 then
elseif abs( 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 +161,7 @@ function BeamLib.RotatePart( Part, nPosition)
nRId = EgtGetNextRawPart( nRId)
end
-- rotazione 180°
elseif nPosition == 3 then
elseif abs( nNumberOfRotations) == 2 then
-- ribalto le travi della fase corrente
local nRId = Part.idRaw
while nRId do
@@ -169,7 +169,7 @@ function BeamLib.RotatePart( Part, nPosition)
nRId = EgtGetNextRawPart( nRId)
end
-- rotazione 270°
elseif nPosition == 4 then
elseif abs( 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