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.
This adds a couple of mesh rendering data classes to allow 2d slices to be plotted in 3d. The basic approach is to generate a fixed resolution buffer from a
YTSlice
and build a uniform hexahedral mesh with the frb values as element-center values (which is then triangulated followingMeshData
). The slice thickness is small (but finite), calculated as a fraction of the cell spacing in the other axes. The newSliceData
class handles all this for a single slice (seeexamples/amr_slices.py
) whileSliceDataComposite
can concatenate multipleSliceData
objects without re-generating the meshes so that the rendering will use a single colormap across the slices (seeexamples/amr_slices_composites.py
).Currently a draft PR because assembling the unstructured mesh is slow -- started with a brute force nested loop that needs to be improved (should be vectorizable, or maybe yt has some utility to help here...). The examples here take ~15 seconds per slice to generate the
SliceData
objects. Once generated and added to the rendering context, it's fast! (also haven't run any style checks yet...)Here's a couple screen shots from the single slice example: