0

I am trying to visualise a 3d point cloud. My specific case is that i broke down the point cloud into N (x-y) planes perform some processing . After this i wish to visualise it such that when the open3d screen is open as each plane is being read it is visualised on the screen and after a time delay the next plane is added .

This link looks similar but dosent work in my case: Adding new points to point cloud in real time - Open3D

My input data is in the form of a sorted list eg [[1,2,3],[1,5,6],[7,8,9],[7,9,10]]. Where planes are formed based on having the same x coordinate value. I also have another list that saves the index of each plane which i was using in the loop

I would be grateful if someone could provide me with a tested out script or any idea.

I tried :

import open3d as o3d
import numpy as np
import time


# create visualizer and window.
vis = o3d.visualization.Visualizer()
vis.create_window()
point0=np.array(sorted_arr[0])
# initialize pointcloud instance.


pcd = o3d.geometry.PointCloud()
# *optionally* add initial points
points = point0
pcd.points = o3d.utility.Vector3dVector([points])

# include it in the visualizer before non-blocking visualization.
vis.add_geometry(pcd)

# to add new points each dt secs.
dt = 0.01
# number of points that will be added
#n_new = 10

previous_t = time.time()

i=0
keep_running = True
while (keep_running==True):
    
    if time.time() - previous_t > dt:
        # Options (uncomment each to try them out):
        # 1) extend with ndarrays.
        
        if((i+1)==(len(temp)-2)):
            x=input("ENTER")
            keep_running=False
        else:
            pcd.points.extend(np.array(sorted_arr[temp[i]:temp[i+1]]))
            print(i)
            i=i+1
        
       
        
        vis.update_geometry(pcd)
        previous_t = time.time()

    #keep_running = vis.poll_events()
    vis.update_renderer()

vis.destroy_window()

0 Answers0