Plotly.js mesh3D performance

plotly mesh3d animate is quite slow at 320K points (and very very slow at 1M points)

I was hoping if I set “opacity=1”, that means only the surface points are drawn (since the inside points become invisible) so I thought that would speed up performance. But that seems to have no impact at all?

I also tried with transition duration to 0 and easing to ‘linear’

Has anyone been able to make any headway with meshes of 1M+ points? Or should I try webGL with three.js?

Hi, several things to mention here.

  1. Plotly.js is using WebGL too as far as I understand. I have seen post about Plotly.Js being limited to number of concurrent “contexts” being displayed, but then I read this limitation refers to WebGL, not to Plotly. There are workarounds online to create “virtual contexts”, i.e. lumping many contexts into few to overcome WebGL limits. So I don’t think ThreeJs is handling WebGL any better.
  2. I tried Three.js to plot error ellipsoids in 3D space, it’s very versatile indeed. However, I quickly learned that Three.js is lacking features such as A) drawing stuff to real scale (everything has to be recalculated to viewport pixels) B) numbered axes and grid lines. These two deficiencies were a real turn off for me, because they are required for any engineering visualization.
  3. When you draw 3D stuff, it is enough to outline surface coordinates and draw convex hull around them, so opacity shouldn’t matter here because there are no point inside convex hull.
  4. When you draw a 3d mesh, always supplement surface coordinates with i,j,k indices (faces), otherwise, when these are not provided, Plotly has to work out these indices on the fly using convex hull and other algorithms. Since it is being done on the fly, optimizations are used under the hood. In my case, ellipsoids come out VERY jagged and ugly without faces (i,j,k) being provided. You can use buffer geometry module from Three.js to get shape coordinates and face indices, then feed them into Plotly. It worked for me just fine.

Hope this helps you in any way.

Cheers, Slava.