widgetti / ipyvolume

3d plotting for Python in the Jupyter notebook based on IPython widgets using WebGL
MIT License
1.93k stars 234 forks source link

Improvement suggestions and a few bugs #37

Open chrisjsewell opened 7 years ago

chrisjsewell commented 7 years ago

Hey Maarten, I've just got round to making a more comprehensive worked example of how I'm building on ipyvolume (for visualisation of atomic data). Which is available as a Notebook, PDF, HTML or Reveal.JS slideshow document (take your pick! ). During this I compiled a todo list with some improvements and minor bugs that I noticed:

I'll try and address some myself and obviously some of these are niche for my use, but though it my be good to put it here, so its in your thinking.

Ta, Chris

maartenbreddels commented 7 years ago

Hi Chris,

thanks again for sharing you work, looks awesome!

better control of spheres

I think the best way to attack this is to push the integration of ipyvolume with pythreejs, see https://github.com/jovyan/pythreejs/issues/109 for this discussion. Then I think we can allow the geo trait to be an instance of the pythreejs.Mesh, giving ultimate freedom of shapes.

creation of array of arbitrary lines (like scatter but with; x0,y0,z0,x1,y1,z1)

I've started this a bit, see Scatter.connected, but it still needs disabling of drawing the glyphs. On top of that it needs to be reflected in the pylab API.

show nearest-neighbour coordination: polygons with vertices at nearest-neighbour positions

Not sure what you mean by this, can you elaborate?

functional (browser side) controls, e.g. slider to translate/rotate point set. Not yet implemented in ipywidgets, see this issue for current status.

We can start thinking about implementing this in ipyvolume, it doesn't have a high high priority for me though.

volumes

isosurface rendering has started

fullscreen

Can you make separate issues for the bugs, with an example. Although I understand the issue with multiple views and fullscreen.. need to think how to solve that.

2d volume representation

Yes, nice idea, wonder if that can be done realtime in a shader, I think it would be possible.

cheers,

Maarten

chrisjsewell commented 7 years ago

No worries, thanks for the package!

Yes obviously the integration of ipyvolume with pythreejs will definitely open doors. Actually I have a question you may be able to shed light on: before I became aware of ipyvolume I was making the atom visualisations in pythreejs. However, anything more than ~20 spheres and the rendering became really slow, even if I used the same Geometry and Material instance for all the meshes. How comes this isn't an issue in ipyvolume?

To explain the nearest-neighbour coordination. So for baseline parity with a more traditional atomic 3d packages, I'd want to replicate this kind of image: crystal representation

maartenbreddels commented 7 years ago

I'm using the InstancedBufferGeometry which will only send the coordinates of the sphere once to the gpu, and execute the shaders many times, still surprised that just 20 spheres becomes slow.

Still not sure what you want exactly though. Should it be a static rendering, because you can now render meshes using pylab.plot_mesh. Or should I respond to mouse interactions?

chrisjsewell commented 7 years ago

Ah ok, yeh may a little more than 20 but really not a lot. Just static rendering for now, pylab.plot_mesh should do the job then ta