Corretto inversione pezzo
This commit is contained in:
+13
-5
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user