@@ -929,6 +929,36 @@ def test_cupy_buffers_multi_gas(test_cupy):
929929 np .testing .assert_almost_equal (hits_np [0 ], 10.0 , decimal = 1 )
930930
931931
932+ @pytest .mark .parametrize ("test_cupy" , [False , True ])
933+ def test_has_geometry (test_cupy ):
934+ """Test has_geometry() query method."""
935+ if test_cupy :
936+ if not has_cupy :
937+ pytest .skip ("cupy not available" )
938+ import cupy
939+ backend = cupy
940+ else :
941+ backend = np
942+
943+ rtx = RTX ()
944+ rtx .clear_scene ()
945+
946+ # Should not exist initially
947+ assert rtx .has_geometry ("test_geo" ) == False
948+
949+ # Add geometry
950+ verts = backend .float32 ([0 , 0 , 0 , 1 , 0 , 0 , 0.5 , 1 , 0 ])
951+ tris = backend .int32 ([0 , 1 , 2 ])
952+ rtx .add_geometry ("test_geo" , verts , tris )
953+
954+ # Should exist now
955+ assert rtx .has_geometry ("test_geo" ) == True
956+
957+ # Remove and check again
958+ rtx .remove_geometry ("test_geo" )
959+ assert rtx .has_geometry ("test_geo" ) == False
960+
961+
932962# =============================================================================
933963# Primitive ID and Instance ID Tests
934964# =============================================================================
@@ -946,7 +976,6 @@ def test_primitive_ids_single_gas(test_cupy):
946976
947977 rtx = RTX ()
948978 rtx .clear_scene ()
949-
950979 # Create a mesh with 2 triangles (a quad)
951980 # Triangle 0: vertices 0,1,2 (bottom-left triangle)
952981 # Triangle 1: vertices 2,1,3 (top-right triangle)
0 commit comments