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
streamlines filter #199
streamlines filter #199
Conversation
Note that I had to convert the blood vessel dataset to point data: mesh = examples.download_blood_vessels().cell_data_to_point_data() I have no idea why, but this implementation currently does not handle vector field on the cells of a mesh... ParaView has no issue with it so I wonder what's different? Maybe they're running a cell data to point data filter behind the scenes? |
Thanks for such fast work!
I am able to reproduce your plot at test_streamlines.ipynb Looks great. No major things to add.
Yeah that's weird. |
I want to point out that this is an awesome demonstration of |
That should be expected because the
This is fair - we haven't documented the difference between point and cell data very well in import vtki
from vtki import examples
mesh = examples.load_uniform()
p = vtki.Plotter(shape=(1,2))
p.add_mesh(mesh, scalars='Spatial Cell Data', show_edges=True)
p.subplot(0,1)
p.add_mesh(mesh, scalars='Spatial Point Data', show_edges=True)
p.show() In As for the As for why the cells array is 9 times the length of your number of cells, this is because you have a mesh where all of the cells are of the same type and defined by 8 node locations (the points of the voxel) - the 9th element comes from having to separate the cell indices to make individual cells. The note that the # using init snippet above
mesh = mesh.cast_to_unstructured_grid()
print(mesh.cells[0:9]) [ 8 0 1 10 11 100 101 110 111] last_cells_nodes = mesh.points[mesh.cells[-8:]]
p = vtki.Plotter()
p.add_mesh(mesh, show_edges=True)
p.add_mesh(last_cells_nodes, point_size=10)
p.show() |
@banesullivan Thanks for this detailed explanation; this makes it much clearer!
Yeah this is also what I imagined. Point data are like finite difference grids and cell data are like finite volume grids.
Thanks for the clarification. I naively expected that |
Resolve #198
This adds a
.streamlines()
filter that will integrate a vector field to generate streamlines.Todo:
@JiaweiZhuang: would you look over these changes and provide feedback?
Example A:
Example B: