def get_voxel_resolution(pc, patch_size):
    """
    This function takes in a pointcloud and returns the resolution 
    of a voxel given that there will be a fixed number of voxels. 
    For example if patch_size is 40, then we are determining the 
    side length of a single voxel in meters. Sovoxel_resolution
    may end up being something like 0.01 for a 1cm^3 voxel size
    jaccard_distance
    :type pc: numpy.ndarray
    :param pc: nx3 numpy array representing a pointcloud

    :type patch_size: int
    :param patch_size: int, how many voxels are there going to be.

    :rtype voxel_resolution: float

    """

    if not pc.shape[1] == 3:
        raise Exception("Invalid pointcloud size, should be nx3, but is {}".format(pc.shape))

    min_x = pc[:, 0].min()
    min_y = pc[:, 1].min()
    min_z = pc[:, 2].min()
    max_x = pc[:, 0].max()
    max_y = pc[:, 1].max()
    max_z = pc[:, 2].max()

    max_dim = max((max_x - min_x),
                  (max_y - min_y),
                  (max_z - min_z))

    voxel_resolution = (1.0 * max_dim) / patch_size

    return voxel_resolution