@@ -23,10 +23,10 @@ def setUp(self):
23
23
port = self .vis .url ().split (":" )[- 1 ].split ("/" )[0 ]
24
24
self .dummy_proc = subprocess .Popen ([sys .executable , "-m" , "meshcat.tests.dummy_websocket_client" , str (port )])
25
25
else :
26
- self .vis .open ()
26
+ # self.vis.open()
27
27
self .dummy_proc = None
28
28
29
- self .vis .wait ()
29
+ # self.vis.wait()
30
30
31
31
def tearDown (self ):
32
32
if self .dummy_proc is not None :
@@ -271,6 +271,43 @@ def runTest(self):
271
271
v .set_object (g .TriangularMeshGeometry (vertices , faces , colors ), g .MeshLambertMaterial (vertexColors = True , wireframe = True ))
272
272
273
273
274
+ class TestUUIDCloning (VisualizerTest ):
275
+ def runTest (self ):
276
+ """
277
+ Test that geometry with identical UUIDs are handled correctly.
278
+ """
279
+ v = self .vis ["triangular_mesh" ]
280
+ v .set_transform (tf .rotation_matrix (np .pi / 2 , [0. , 0 , 1 ]))
281
+ vertices = np .array ([
282
+ [0 , 0 , 0 ],
283
+ [1 , 0 , 0 ],
284
+ [1 , 0 , 1 ],
285
+ [0 , 0 , 1 ]
286
+ ])
287
+ faces = np .array ([
288
+ [0 , 1 , 2 ],
289
+ [3 , 0 , 2 ]
290
+ ])
291
+ geom = g .TriangularMeshGeometry (vertices , faces )
292
+ mat = g .MeshLambertMaterial (color = 0xeedd22 , wireframe = True )
293
+ geom .uuid = 1234
294
+ mat .uuid = 5678
295
+ v .set_object (geom , mat )
296
+
297
+ # This should be drawn as a duplicate of the first geometry
298
+ # at and offset; if nothing appears, or the material is different,
299
+ # the UUID lookup did not succeed.
300
+ geom_2 = g .TriangularMeshGeometry (np .empty ((0 , 3 )), np .empty ((0 , 3 )))
301
+ mat_2 = g .MeshLambertMaterial (color = 0x000000 , wireframe = False )
302
+ geom_2 .uuid = 1234
303
+ mat_2 .uuid = 5678
304
+ v2 = v ["duplicate" ]
305
+ v2 .set_transform (tf .translation_matrix ([2. , 0. , 0. ]))
306
+ v2 .set_object (geom_2 , mat_2 )
307
+
308
+ import time
309
+ time .sleep (1000 )
310
+
274
311
class TestOrthographicCamera (VisualizerTest ):
275
312
def runTest (self ):
276
313
"""
0 commit comments