def any_touching(
    scene: Scene,
    a: Union[str, list[str]],
    b: Union[str, list[str]] = None,
    a_tags=None,
    b_tags=None,
    bvh_cache=None,
):
    """
    Computes one-to-one, many-to-one, one-to-many or many-to-many collisions

    In all cases, returns True if any one object from a and b touch
    """
    a, b, a_tags, b_tags = preprocess_collision_query_cases(a, b, a_tags, b_tags)

    col = iu.col_from_subset(scene, a, a_tags, bvh_cache)

    if b is None and len(a) == 1:
        # query makes no sense, asking for intra-set collision on one element
        hit, names, contacts = None, (a, b), []
    elif b is None:
        hit, names, contacts = col.in_collision_internal(
            return_data=True, return_names=True
        )
    elif isinstance(b, str):
        T, g = scene.graph[b]
        hit, names, contacts = col.in_collision_single(
            scene.geometry[g], transform=T, return_data=True, return_names=True
        )
    elif isinstance(b, list):
        col2 = iu.col_from_subset(scene, b, b_tags, bvh_cache)
        hit, names, contacts = col.in_collision_other(
            col2, return_names=True, return_data=True
        )
    else:
        raise ValueError(f"Unhandled case {a=} {b=}")

    names = list(names)
    if len(names) == 1:
        assert isinstance(b, str)
        names.append(b)
        logging.debug(f"added name {b} to make {names}")

    if len(names) == 0:
        names = [a, b]

    return ContactResult(hit=hit, names=names, contacts=contacts)

    Computes one-to-one, many-to-one, one-to-many or many-to-many collisions

    In all cases, returns True if any one object from a and b touch
    
infinigen/core/constraints/evaluator/node_impl/trimesh_geometry.py