def bin_to_pcd(bin_path, outdir=None):
    print(bin_path)
    pcd_arr = np.fromfile(bin_path, dtype=np.float32)
    pcd_arr = pcd_arr.reshape(((- 1), 4))
    if (len(pcd_arr) == 0):
        return None
    outpath = join((Path(bin_path).parent if (outdir is None) else outdir), (splitext(basename(bin_path))[0] + '.pcd'))
    print(outpath)
    pcd = o3d.geometry.PointCloud()
    pcd.points = o3d.utility.Vector3dVector(pcd_arr[:, :3])
    o3d.io.write_point_cloud(outpath, pcd)
    return outpath
def bin_to_pcd(bin_path, outdir=None):
    print(bin_path)
    pcd_arr = np.fromfile(bin_path, dtype=np.float32)
    pcd_arr = pcd_arr.reshape(((- 1), 4))
    if (len(pcd_arr) == 0):
        return None
    outpath = join((Path(bin_path).parent if (outdir is None) else outdir), (splitext(basename(bin_path))[0] + '.pcd'))
    print(outpath)
    pcd = o3d.geometry.PointCloud()
    pcd.points = o3d.utility.Vector3dVector(pcd_arr[:, :3])
    o3d.io.write_point_cloud(outpath, pcd)
    return outpath