def scene_to_dict(scene, use_base64=False):
    """
    Export a Scene object as a dict.

    Parameters
    -------------
    scene : trimesh.Scene
      Scene object to be exported

    Returns
    -------------
    as_dict : dict
      Scene as a dict
    """
    export = {'graph': scene.graph.to_edgelist(), 'geometry': {},
        'scene_cache': {'bounds': scene.bounds.tolist(), 'extents': scene.
        extents.tolist(), 'centroid': scene.centroid.tolist(), 'scale':
        scene.scale}}
    if use_base64:
        file_type = 'dict64'
    else:
        file_type = 'dict'
    for geometry_name, geometry in scene.geometry.items():
        if hasattr(geometry, 'export'):
            exported = {'data': geometry.export(file_type=file_type),
                'file_type': file_type}
            export['geometry'][geometry_name] = exported
        else:
            export['geometry'][geometry_name] = geometry
    return export
