Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement suggestions and a few bugs #37

Open
chrisjsewell opened this issue Aug 1, 2017 · 4 comments
Open

Improvement suggestions and a few bugs #37

chrisjsewell opened this issue Aug 1, 2017 · 4 comments

Comments

@chrisjsewell
Copy link
Contributor

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:

  • Orthographic camera. Not yet implemented in ipyvolume, see this issue for current status.
  • better control of spheres
    • exact control of radii length (radius rather than scaling size)
    • more segments (either direct control of segments, or a "sphere_hi_res" type)
    • transparency/alpha level
    • should color allow (r,g,b) tuple/array?
      because at the moment that doesn't work
  • creation of array of arbitrary lines (like scatter but with; x0,y0,z0,x1,y1,z1)
    • show lattice bounding boxes: parallelepiped wire frames
    • show bonds (i.e. connections) between different scatters
  • show nearest-neighbour coordination: polygons with vertices at nearest-neighbour positions
  • functional (browser side) controls, e.g. slider to translate/rotate point set. Not yet implemented in ipywidgets, see this issue for current status.
  • volumes:
    • RuntimeWarning: invalid value encountered in true_divide
      (serialize.py:43) presumably for (0,0,0) gradients
    • rarely get artifact rendering
    • isosurface rendering
    • multiple volumes in single plot
    • volumes with arbitrary centres
    • rotating volumes
  • fullscreen
    • fails to open if multiple views instantiated
    • if volume is present,
      then the rendering becomes very low resolution
      and, sometimes, the volume disappears completely on exit
  • 2d volume representation
    • define slice into cube and use matplotlib.contour

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
Copy link
Collaborator

maartenbreddels commented Aug 1, 2017

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 jupyter-widgets/pythreejs#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
Copy link
Contributor Author

chrisjsewell commented Aug 1, 2017

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
Copy link
Collaborator

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
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants