2525from OCP .TopTools import TopTools_ListOfShape
2626from OCP .BOPAlgo import BOPAlgo_GlueEnum , BOPAlgo_MakeConnected
2727from OCP .TopoDS import TopoDS_Shape
28+ from OCP .gp import gp_EulerSequence
2829
2930from vtkmodules .vtkRenderingCore import (
3031 vtkActor ,
@@ -259,7 +260,14 @@ def toVTK(
259260 for shape , _ , loc , col_ in assy :
260261
261262 col = col_ .toTuple () if col_ else color
262- trans , rot = loc .toTuple ()
263+ T = loc .wrapped .Transformation ()
264+ trans = T .TranslationPart ().Coord ()
265+ rot = tuple (
266+ map (
267+ degrees ,
268+ T .GetRotation ().GetEulerAngles (gp_EulerSequence .gp_Intrinsic_ZXY ),
269+ )
270+ )
263271
264272 data = shape .toVtkPolyData (tolerance , angularTolerance )
265273
@@ -290,7 +298,7 @@ def toVTK(
290298 actor = vtkActor ()
291299 actor .SetMapper (mapper )
292300 actor .SetPosition (* trans )
293- actor .SetOrientation (* map ( degrees , rot ) )
301+ actor .SetOrientation (rot [ 1 ] , rot [ 2 ], rot [ 0 ] )
294302 actor .GetProperty ().SetColor (* col [:3 ])
295303 actor .GetProperty ().SetOpacity (col [3 ])
296304
@@ -302,7 +310,7 @@ def toVTK(
302310 actor = vtkActor ()
303311 actor .SetMapper (mapper )
304312 actor .SetPosition (* trans )
305- actor .SetOrientation (* map ( degrees , rot ) )
313+ actor .SetOrientation (rot [ 1 ] , rot [ 2 ], rot [ 0 ] )
306314 actor .GetProperty ().SetColor (0 , 0 , 0 )
307315 actor .GetProperty ().SetLineWidth (2 )
308316
0 commit comments