def get_query_pts_dist_ms(
        base_dir, dataset_dir, dir_in_mesh,
        dir_out_query_pts_ms,
        dir_out_query_dist_ms,
        dir_out_query_vis,
        patch_radius,
        num_query_pts=2000,
        far_query_pts_ratio=0.1,
        signed_distance_batch_size=1000,
        num_processes=8,
        debug=False):
    """
    Get query points and their GT signed distances in model space.
    :param base_dir:
    :param dataset_dir:
    :param dir_in_mesh:
    :param dir_out_query_pts_ms:
    :param dir_out_query_dist_ms:
    :param dir_out_query_vis:
    :param patch_radius:
    :param num_query_pts:
    :param far_query_pts_ratio:
    :param signed_distance_batch_size:
    :param num_processes:
    :param debug:
    :return:
    """

    import os.path
    from source.base import file_utils

    dir_in_mesh_abs = os.path.join(base_dir, dataset_dir, dir_in_mesh)
    dir_out_query_pts_abs = os.path.join(base_dir, dataset_dir, dir_out_query_pts_ms)
    dir_out_query_dist_abs = os.path.join(base_dir, dataset_dir, dir_out_query_dist_ms)
    dir_out_query_vis_abs = os.path.join(base_dir, dataset_dir, dir_out_query_vis)

    os.makedirs(dir_out_query_pts_abs, exist_ok=True)
    os.makedirs(dir_out_query_dist_abs, exist_ok=True)
    if debug:
        os.makedirs(dir_out_query_vis_abs, exist_ok=True)

    # get query points
    print('### get query points')
    call_params = []
    files_mesh = [f for f in os.listdir(dir_in_mesh_abs)
                  if os.path.isfile(os.path.join(dir_in_mesh_abs, f)) and f[-4:] == '.ply']
    for fi, f in enumerate(files_mesh):
        file_in_mesh = os.path.join(dir_in_mesh_abs, f)
        file_out_query_pts = os.path.join(dir_out_query_pts_abs, f + '.npy')
        file_out_query_dist = os.path.join(dir_out_query_dist_abs, f + '.npy')
        file_out_query_vis = os.path.join(dir_out_query_vis_abs, f + '.ply')

        if file_utils.call_necessary(file_in_mesh, [file_out_query_pts, file_out_query_dist]):
            call_params.append((file_in_mesh, file_out_query_pts, file_out_query_dist, file_out_query_vis,
                                num_query_pts, patch_radius, far_query_pts_ratio,
                                signed_distance_batch_size, debug))

    utils_mp.start_process_pool(_get_and_save_query_pts, call_params, num_processes)

    Get query points and their GT signed distances in model space.
    :param base_dir:
    :param dataset_dir:
    :param dir_in_mesh:
    :param dir_out_query_pts_ms:
    :param dir_out_query_dist_ms:
    :param dir_out_query_vis:
    :param patch_radius:
    :param num_query_pts:
    :param far_query_pts_ratio:
    :param signed_distance_batch_size:
    :param num_processes:
    :param debug:
    :return:
    
make_dataset.py