-
Notifications
You must be signed in to change notification settings - Fork 5
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
WIP: Isolayer updates #140
Draft
chrishavlin
wants to merge
7
commits into
yt-project:main
Choose a base branch
from
chrishavlin:isolayer_updates
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8d018aa
use isolayer min/max to avoid normalization issue
chrishavlin 6ec51e7
add test, example with iso contours
chrishavlin 4967ea8
move isolayer logic to separate mixin-like class
chrishavlin a7c99e1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 80612c0
rm unused import
chrishavlin f02a935
move isolayers to dedicated component
chrishavlin 4ca116a
update the test
chrishavlin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import yt | ||
import yt_idv | ||
|
||
ds = yt.load_sample("IsolatedGalaxy") | ||
|
||
rc = yt_idv.render_context(height=800, width=800, gui=True) | ||
sg = rc.add_scene(ds, "density", no_ghost=True) | ||
sg.components[0].render_method = 'isocontours' | ||
|
||
# default behavior will treat these values as base-10 exponents | ||
sg.components[0].iso_layers[0] = -29.0 | ||
sg.components[0].iso_tolerance[0] = 1.0 # tolerance in percent | ||
|
||
rc.run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@matthewturk any opinio on using a multi-inheritence structure here? was the most convenient way i saw to add the isolayer functionalty to the block rendering while allowing future re-use with octree blocks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(which is why we had initially added it to the base component I think)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, good point. I guess I'm OK with it, but I also wonder if this should just be either a different shader (which I guess would open up multiple issues with having new uniforms that are conditionally modified) or a different component referencing the same data object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a different component is actually a great idea. And we could have a "add isolayer" button similar to the button for adding a grid outline. And it would allow viewing both isolayers and a volume rendering at once (though I'm not sure this would work right away... Offhand I don't remember how the different components are blended, might be some depth buffer issues...).