def test_download_blood_vessels(): """Tests the parallel VTU reader""" data = examples.download_blood_vessels() assert isinstance(data, pyvista.UnstructuredGrid)
p = pv.Plotter() p.add_mesh(mesh.outline(), color="k") p.add_mesh(streamlines.tube(radius=0.15)) p.add_mesh(src) p.add_mesh(mesh.contour([160]).extract_all_edges(), color="grey", opacity=0.25) p.camera_position = [(182.0, 177.0, 50), (139, 105, 19), (-0.2, -0.2, 1)] p.show() ############################################################################### # Blood Vessels # +++++++++++++ # Here is another example of blood flow: mesh = examples.download_blood_vessels().cell_data_to_point_data() mesh.set_active_scalars("velocity") streamlines, src = mesh.streamlines( return_source=True, source_radius=10, source_center=(92.46, 74.37, 135.5) ) ############################################################################### boundary = mesh.decimate_boundary().extract_all_edges() p = pv.Plotter() p.add_mesh(streamlines.tube(radius=0.2), lighting=False) p.add_mesh(src) p.add_mesh(boundary, color="grey", opacity=0.25) p.camera_position = [(10, 9.5, -43), (87.0, 73.5, 123.0), (-0.5, -0.7, 0.5)] p.show()
~~~~~~~~~~~~~~ The VTK library supports parallel file foramts. Reading meshes broken up into several files is natively supported by VTK and PyVista """ # sphinx_gallery_thumbnail_number = 1 import pyvista as pv from pyvista import examples import os ############################################################################### # Let's go ahead and download the sample dataset containing an # :class:`pyvista.UnstructuredGrid` broken up into several files. # Do not capture output because we'll demo how to read the file examples.download_blood_vessels() ############################################################################### # The above code downloaded a dataset containing a set of parallel files for a # blood vessel mesh and returned an :class:`pyvista.UnstructuredGrid` - we did # not grab that UnstructuredGrid, so that we could demo how to use these types # of files. # # Let's inspect where this downloaded our dataset: path = os.path.join(pv.EXAMPLES_PATH, "blood_vessels") print(os.listdir(path)) ############################################################################### print(os.listdir(os.path.join(path, "T0000000500"))) ###############################################################################
def __init__(self): self._example_data = examples.download_blood_vessels() _ExampleLoader.__init__(self)