2424
2525
2626plotter = None
27- offset_ = 0
27+ offset3d_ = ( 0 , 0 , 0 )
2828slider = None
2929
3030show_boundary = False
@@ -59,12 +59,19 @@ def add_sibernetic_model(
5959 position_file = "Sibernetic/position_buffer.txt" ,
6060 report_file = None ,
6161 swap_y_z = False ,
62- offset = 0 ,
62+ offset3d = ( 0 , 0 , 0 ) ,
6363 include_boundary = False ,
6464):
65- global all_points , all_point_types , last_meshes , plotter , offset_ , slider , show_boundary
66-
67- offset_ = offset
65+ global \
66+ all_points , \
67+ all_point_types , \
68+ last_meshes , \
69+ plotter , \
70+ offset3d_ , \
71+ slider , \
72+ show_boundary
73+
74+ offset3d_ = offset3d
6875 plotter = pl
6976 show_boundary = include_boundary
7077
@@ -226,7 +233,7 @@ def play_animation(play):
226233def create_mesh (step ):
227234 step_count = step
228235 value = step_count
229- global all_points , last_meshes , plotter , offset_ , replaying , show_boundary
236+ global all_points , last_meshes , plotter , offset3d_ , replaying , show_boundary
230237
231238 index = int (value )
232239 if index >= len (all_points ):
@@ -257,7 +264,7 @@ def create_mesh(step):
257264 continue
258265 if type_ not in last_meshes :
259266 last_meshes [type_ ] = pv .PolyData (curr_points )
260- last_meshes [type_ ].translate (( 0 , 0 , 0 ) , inplace = True )
267+ last_meshes [type_ ].translate (offset3d_ , inplace = True )
261268
262269 # last_actor =
263270 plotter .add_mesh (
@@ -269,7 +276,9 @@ def create_mesh(step):
269276 else :
270277 if not is_boundary :
271278 last_meshes [type_ ].points = curr_points
272- last_meshes [type_ ].translate ((offset_ , 0 , 0 ), inplace = True )
279+ last_meshes [type_ ].translate (
280+ (offset3d_ [0 ], offset3d_ [1 ], offset3d_ [2 ]), inplace = True
281+ )
273282 else :
274283 print ("Boundary points not translated" )
275284
0 commit comments