glue-viz / glue-vispy-viewers

3-d data viewers for glue based on VisPy
http://glueviz.org/en/stable/whatsnew/experimental_3d.html#experimental-3d
BSD 2-Clause "Simplified" License
25 stars 21 forks source link

Added option to have an arbitrarily oriented cutting plane #392

Open astrofrog opened 1 week ago

astrofrog commented 1 week ago

This still needs some more testing, and need to think about best way to actually expose the parameters to the user. Example of adjusting the cutting plane interactively in Jupyter:

from ipywidgets import interact

@interact(a=(-1., 1.))
def update_a(a):
    current = list(vol.state.cutting_plane)
    current[0] = a
    vol.state.cutting_plane = current

@interact(b=(-1., 1.))
def update_b(b):
    current = list(vol.state.cutting_plane)
    current[1] = b
    vol.state.cutting_plane = current

@interact(c=(-1., 1.))
def update_c(c):
    current = list(vol.state.cutting_plane)
    current[2] = c
    vol.state.cutting_plane = current

@interact(d=(-256., 256.))
def update_d(d):
    current = list(vol.state.cutting_plane)
    current[3] = d
    vol.state.cutting_plane = current

Main TODOs: