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

Added option to have an arbitrarily oriented cutting plane #392

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

astrofrog
Copy link
Member

@astrofrog astrofrog commented Nov 14, 2024

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:

  • Have a toggle in the shaders for turning cutting plane on/off
  • Implement UI options to set the cutting plane - could have simple mode where one just cuts in x, y, or z, and then have an advanced mode where all the coefficients can be edited.
  • Added visual tests (either here or in glue-jupyter)

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

Successfully merging this pull request may close these issues.

1 participant