Corretto inversione pezzo

This commit is contained in:
andrea.villa
2025-07-14 10:26:09 +02:00
parent b298bd24e7
commit fd070db4d0
3 changed files with 14 additions and 8 deletions
+13 -5
View File
@@ -189,12 +189,20 @@ function BeamLib.InvertRawPart( Part, nNumberOfRotations)
if nNumberOfRotations == 0 then
return
end
--TODO è giusto ruotare il pezzo all'interno del grezzo, ma sembra non funzionare correttamente. Appena sistemato, cambiare richiamo funzione con questa commentata
--EgtRotatePartInRawPart( Part.id, Z_AX(), nNumberOfRotations * 90)
EgtRotateRawPart( Part.idRaw, Z_AX(), nNumberOfRotations * 90)
-- box del solido
local b3BoxPart = EgtGetBBoxGlob( EgtGetFirstNameInGroup( Part.id or GDB_ID.NULL, 'Box') or GDB_ID.NULL, GDB_BB.EXACT)
-- box esatto del pezzo
local b3BoxExact = EgtGetBBoxGlob( Part.id or GDB_ID.NULL, GDB_BB.EXACT)
-- rotazione
local dAngRot = nNumberOfRotations * 90
EgtRotatePartInRawPart( Part.id, Z_AX(), dAngRot)
-- correggo per eccentricità solido rispetto a geometria complessiva del pezzo
local vtEccOri = b3BoxPart:getCenter() - b3BoxExact:getCenter()
local vtEccRot = Vector3d( vtEccOri)
vtEccRot:rotate( Z_AX(), dAngRot)
EgtMovePartInRawPart( Part.id, ( vtEccOri - vtEccRot))
end
-------------------------------------------------------------------------------------------------------------
--- funzione che ruota il grezzo
function BeamLib.RotateRawPart( Part, nNumberOfRotations)