isl-org / Open3D

Open3D: A Modern Library for 3D Data Processing
http://www.open3d.org
Other
11.44k stars 2.3k forks source link

Add multiple (>1000) geometries to O3DVisualizer with update through time #3920

Open SamTov opened 3 years ago

SamTov commented 3 years ago

Is your feature request related to a problem? Please describe. I am using open3D to make visualisation engine for particle trajectories. For each particle I must render a mesh, typically a sphere. Making the initial scene is quite simple but when I wish to run the trajectory through time I am unsure of the best way to go. Typically I think of one of the follow:

  1. Apply a transformation to all spheres. This is fine but very slow, particularly if the loop is in Python.
  2. Make all the scenes at the initialisation stage and just display a new scene. I don't know how this is possible in Open3D.
  3. Re-draw the spheres in their new positions in the same visualiser. This I think could be the best way, however, I have to add each sphere one at a time using the vis.add_geometry method. If I could add all the sphere (or at least do it vectorized) this would probably be the best approach.

I am just looking for some ideas about the best way to do this. Typically I want to visualise >1000 particles and so performance is fairly important. Any ideas would be greatly appreciated.

ssheorey commented 3 years ago

For option 3: update_geometry() is faster than using remove_geometry() + add_geometry() to update the particle. Currently only point clouds are supported, but mesh support is expected in a few weeks.

In the mean time, can you test update_geometry() with only the vertices in your particle mesh and check if that is fast enough for your application?

http://www.open3d.org/docs/latest/python_api/open3d.visualization.rendering.Scene.html?highlight=update_geometry#open3d.visualization.rendering.Scene.update_geometry

[This is a method of the lower level Scene class]

ssheorey commented 3 years ago

Also, Open3D can easily handle meshes with >10M points / triangles (limited by your GPU). Another thing would be to make a single mesh from all of your particles and update that at each time point.

SamTov commented 3 years ago

Thats good to know, I assumed the engine was capable of handling it I just was quite unsure of the best way to implement it. When it comes to creating a single mesh, how would I do this using N spheres as well as the update?

SamTov commented 3 years ago

@ssheorey Is there any update on when the update_geometry() function will support meshes?