CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-pyvista

Easier Pythonic interface to VTK for 3D scientific data visualization and mesh analysis

Pending
Overview
Eval results
Files

examples.mddocs/

Example Datasets

PyVista provides an extensive collection of built-in and downloadable example datasets for testing, learning, and demonstration purposes, including geometric models, scientific data, and real-world datasets.

Capabilities

Built-in Examples

Basic Geometric Examples

Simple datasets included with PyVista installation.

def load_ant() -> PolyData:
    """
    Load ant mesh dataset.
    
    Returns:
        PolyData: Ant surface mesh
    """

def load_airplane() -> PolyData:
    """
    Load airplane mesh dataset.
    
    Returns:
        PolyData: Airplane surface mesh
    """

def load_sphere() -> PolyData:
    """
    Load sphere mesh dataset.
    
    Returns:
        PolyData: Spherical mesh with texture coordinates
    """

def load_nut() -> PolyData:
    """
    Load nut (hardware) mesh dataset.
    
    Returns:
        PolyData: Nut surface mesh
    """

Grid Examples

Sample structured and unstructured grid datasets.

def load_uniform() -> ImageData:
    """
    Load uniform grid example.
    
    Returns:
        ImageData: 3D uniform grid with sample data
    """

def load_rectilinear() -> RectilinearGrid:
    """
    Load rectilinear grid example.
    
    Returns:
        RectilinearGrid: Non-uniform rectilinear grid
    """

def load_structured() -> StructuredGrid:
    """
    Load structured grid example.
    
    Returns:
        StructuredGrid: Curvilinear structured grid
    """

def load_hexbeam() -> UnstructuredGrid:
    """
    Load hexahedral beam mesh.
    
    Returns:
        UnstructuredGrid: Hexahedral finite element mesh
    """

def load_tetbeam() -> UnstructuredGrid:
    """
    Load tetrahedral beam mesh.
    
    Returns:
        UnstructuredGrid: Tetrahedral finite element mesh
    """

def load_globe() -> PolyData:
    """
    Load globe mesh with continents.
    
    Returns:
        PolyData: Earth globe surface mesh
    """

def load_globe_texture() -> ImageData:
    """
    Load globe texture image.
    
    Returns:
        ImageData: Earth texture map
    """

def load_channels() -> UnstructuredGrid:
    """
    Load channels flow dataset.
    
    Returns:
        UnstructuredGrid: Flow field data
    """

def load_spline() -> PolyData:
    """
    Load spline curve dataset.
    
    Returns:
        PolyData: Spline curve mesh
    """

def load_random_hills() -> PolyData:
    """
    Load random hills surface.
    
    Returns:
        PolyData: Random hills terrain
    """

def load_sphere_vectors() -> PolyData:
    """
    Load sphere with vector field.
    
    Returns:
        PolyData: Sphere with vector data
    """

def load_explicit_structured(dimensions=(5, 6, 7), spacing=(20, 10, 1)) -> ExplicitStructuredGrid:
    """
    Load explicit structured grid example.
    
    Parameters:
        dimensions (tuple): Grid dimensions
        spacing (tuple): Grid spacing
        
    Returns:
        ExplicitStructuredGrid: Example structured grid
    """

def load_frog_tissues() -> ImageData:
    """
    Load frog tissue scan data.
    
    Returns:
        ImageData: Frog tissue volume
    """

def load_hydrogen_orbital(n=1, l=0, m=0, zoom_fac=1.0) -> ImageData:
    """
    Load hydrogen orbital dataset.
    
    Parameters:
        n (int): Principal quantum number
        l (int): Orbital angular momentum quantum number
        m (int): Magnetic quantum number
        zoom_fac (float): Zoom factor
        
    Returns:
        ImageData: Hydrogen orbital volume
    """

def load_logo() -> PolyData:
    """
    Load PyVista logo mesh.
    
    Returns:
        PolyData: PyVista logo
    """

Downloadable Datasets

Anatomical and Medical Data

Medical imaging and anatomical datasets.

def download_head() -> ImageData:
    """
    Download head CT scan dataset.
    
    Returns:
        ImageData: Medical imaging volume data
    """

def download_brain() -> ImageData:
    """
    Download brain MRI dataset.
    
    Returns:
        ImageData: Brain volume with tissue segmentation
    """

def download_knee() -> ImageData:
    """
    Download knee MRI dataset.
    
    Returns:
        ImageData: Knee joint imaging data
    """

def download_chest() -> ImageData:
    """
    Download chest CT scan.
    
    Returns:
        ImageData: Chest cavity imaging data
    """

def download_foot_bones() -> PolyData:
    """
    Download foot bone meshes.
    
    Returns:
        PolyData: Foot bone surface models
    """

def download_skull() -> PolyData:
    """
    Download skull surface model.
    
    Returns:
        PolyData: Human skull mesh
    """

Natural and Organic Models

Real-world scanned objects and natural forms.

def download_bunny() -> PolyData:
    """
    Download Stanford bunny mesh.
    
    Famous computer graphics test model.
    
    Returns:
        PolyData: Stanford bunny surface mesh
    """

def download_dragon() -> PolyData:
    """
    Download Stanford dragon mesh.
    
    Returns:
        PolyData: Dragon surface mesh
    """

def download_cow() -> PolyData:
    """
    Download cow mesh dataset.
    
    Returns:
        PolyData: Cow surface model
    """

def download_horse() -> PolyData:
    """
    Download horse mesh dataset.
    
    Returns:
        PolyData: Horse surface model
    """

def download_teapot() -> PolyData:
    """
    Download Utah teapot mesh.
    
    Classic computer graphics reference object.
    
    Returns:
        PolyData: Teapot surface mesh
    """

def download_armadillo() -> PolyData:
    """
    Download armadillo mesh.
    
    Returns:
        PolyData: Armadillo surface model
    """

Mechanical and Engineering Objects

CAD models and mechanical components.

def download_gears() -> PolyData:
    """
    Download gear assembly mesh.
    
    Returns:
        PolyData: Mechanical gear system
    """

def download_motor() -> MultiBlock:
    """
    Download electric motor assembly.
    
    Returns:
        MultiBlock: Multi-part motor model
    """

def download_turbine_blade() -> PolyData:
    """
    Download turbine blade mesh.
    
    Returns:
        PolyData: Turbine blade geometry
    """

def download_pump_bracket() -> PolyData:
    """
    Download pump bracket CAD model.
    
    Returns:
        PolyData: Mechanical bracket mesh
    """

def download_bearing() -> PolyData:
    """
    Download bearing assembly.
    
    Returns:
        PolyData: Ball bearing mesh
    """

def download_bolt_nut() -> MultiBlock:
    """
    Download bolt and nut assembly.
    
    Returns:
        MultiBlock: Bolt and nut models
    """

Scientific and Simulation Data

Scientific datasets and simulation results.

def download_blood_vessels() -> PolyData:
    """
    Download blood vessel network.
    
    Returns:
        PolyData: Vascular network mesh
    """

def download_iron_protein() -> ImageData:
    """
    Download iron protein molecular data.
    
    Returns:
        ImageData: Molecular density volume
    """

def download_combustion() -> ImageData:
    """
    Download combustion simulation data.
    
    Returns:
        ImageData: Temperature and pressure fields
    """

def download_hurricane() -> StructuredGrid:
    """
    Download hurricane simulation data.
    
    Returns:
        StructuredGrid: Atmospheric pressure and wind fields
    """

def download_kitchen() -> StructuredGrid:
    """
    Download kitchen air flow simulation.
    
    Returns:
        StructuredGrid: Velocity and temperature fields
    """

def download_carotid() -> PolyData:
    """
    Download carotid artery mesh.
    
    Returns:
        PolyData: Arterial geometry
    """

Geological and Environmental Data

Earth science and environmental datasets.

def download_topo_global() -> PolyData:
    """
    Download global topography mesh.
    
    Returns:
        PolyData: Earth surface with elevation data
    """

def download_topo_land() -> PolyData:
    """
    Download land topography.
    
    Returns:
        PolyData: Continental topography mesh
    """

def download_st_helens() -> ImageData:
    """
    Download Mount St. Helens DEM.
    
    Returns:
        ImageData: Digital elevation model
    """

def download_crater() -> PolyData:
    """
    Download crater topography.
    
    Returns:
        PolyData: Crater surface mesh
    """

def download_geological_map() -> PolyData:
    """
    Download geological formation data.
    
    Returns:
        PolyData: Geological surface with formation data
    """

Planetary and Astronomical Data

Space science and planetary datasets.

def download_mars() -> ImageData:
    """
    Download Mars surface data.
    
    Returns:
        ImageData: Martian topography and imagery
    """

def download_moon() -> ImageData:
    """
    Download lunar surface data.
    
    Returns:
        ImageData: Moon elevation and imagery
    """

def download_jupiter() -> PolyData:
    """
    Download Jupiter surface mesh.
    
    Returns:
        PolyData: Jupiter atmospheric data
    """

def download_saturn_rings() -> PolyData:
    """
    Download Saturn rings model.
    
    Returns:
        PolyData: Saturn ring system
    """

Texture and Image Datasets

Earth Textures

Planetary surface textures and imagery.

def download_earth_texture() -> ImageData:
    """
    Download Earth day texture.
    
    Returns:
        ImageData: Earth surface imagery
    """

def download_earth_night() -> ImageData:
    """
    Download Earth night lights texture.
    
    Returns:
        ImageData: Night illumination imagery
    """

def download_mars_texture() -> ImageData:
    """
    Download Mars surface texture.
    
    Returns:
        ImageData: Martian surface imagery
    """

def download_moon_texture() -> ImageData:
    """
    Download Moon surface texture.
    
    Returns:
        ImageData: Lunar surface imagery
    """

Material Textures

Various material and pattern textures.

def download_masonry_texture() -> ImageData:
    """
    Download masonry wall texture.
    
    Returns:
        ImageData: Brick wall pattern
    """

def download_wood_texture() -> ImageData:
    """
    Download wood grain texture.
    
    Returns:
        ImageData: Wood surface pattern
    """

def download_metal_texture() -> ImageData:
    """
    Download metal surface texture.
    
    Returns:
        ImageData: Metallic surface pattern
    """

Specialized Examples

Computer Graphics Test Cases

Standard computer graphics test models.

def download_suzanne() -> PolyData:
    """
    Download Suzanne monkey head mesh.
    
    Blender's reference model.
    
    Returns:
        PolyData: Suzanne mesh
    """

def download_cessna() -> PolyData:
    """
    Download Cessna aircraft mesh.
    
    Returns:
        PolyData: Aircraft surface model
    """

def download_trumpet() -> PolyData:
    """
    Download trumpet mesh.
    
    Returns:
        PolyData: Musical instrument model
    """

Fluid Dynamics Examples

CFD and fluid simulation datasets.

def download_backward_facing_step() -> UnstructuredGrid:
    """
    Download backward facing step CFD simulation.
    
    Returns:
        UnstructuredGrid: Flow field data
    """

def download_channel_flow() -> StructuredGrid:
    """
    Download channel flow simulation.
    
    Returns:
        StructuredGrid: Velocity and pressure fields
    """

def download_cavity_flow() -> StructuredGrid:
    """
    Download lid-driven cavity flow.
    
    Returns:
        StructuredGrid: Classic CFD benchmark
    """

Dataset Utilities

Download Management

Functions for managing downloaded datasets.

def delete_downloads():
    """Delete all downloaded example datasets to free space."""

def get_downloads_cache_dir() -> str:
    """
    Get path to downloads cache directory.
    
    Returns:
        str: Path to cache directory
    """

def set_downloads_cache_dir(path):
    """
    Set custom downloads cache directory.
    
    Parameters:
        path (str): Path to cache directory
    """

def get_downloads_path(filename):
    """
    Get full path to downloaded file.
    
    Parameters:
        filename (str): Filename of downloaded dataset
        
    Returns:
        str: Full path to file
    """

Example Categories

Access examples by category.

def list_examples() -> dict:
    """
    List all available example datasets by category.
    
    Returns:
        dict: Dictionary of categories and example names
    """

def load_random() -> 'DataSet':
    """
    Load a random example dataset.
    
    Returns:
        DataSet: Random example dataset
    """

Usage Examples

Basic example loading

import pyvista as pv

# Load built-in examples (no download required)
ant = pv.examples.load_ant()
airplane = pv.examples.load_airplane()
sphere = pv.examples.load_sphere()

# Plot built-in examples
plotter = pv.Plotter(shape=(1, 3))
plotter.subplot(0, 0)
plotter.add_mesh(ant, color='red')
plotter.subplot(0, 1)
plotter.add_mesh(airplane, color='blue')
plotter.subplot(0, 2)
plotter.add_mesh(sphere, color='green')
plotter.show()

Working with downloaded datasets

import pyvista as pv

# Download and visualize medical data
brain = pv.examples.download_brain()
head = pv.examples.download_head()

# Visualize volumetric data
brain.plot(volume=True, cmap='bone')

# Download and plot surface models
bunny = pv.examples.download_bunny()
dragon = pv.examples.download_dragon()

# Create comparison plot
plotter = pv.Plotter(shape=(1, 2))
plotter.subplot(0, 0)
plotter.add_mesh(bunny, color='pink')
plotter.add_title("Stanford Bunny")
plotter.subplot(0, 1)
plotter.add_mesh(dragon, color='green')  
plotter.add_title("Stanford Dragon")
plotter.show()

Scientific data visualization

import pyvista as pv

# Load simulation data
hurricane = pv.examples.download_hurricane()
combustion = pv.examples.download_combustion()

# Visualize hurricane wind vectors
hurricane.plot(scalars='wind_speed', arrows='wind_vectors', 
               cmap='coolwarm', show_scalar_bar=True)

# Create isosurfaces from combustion data
iso = combustion.contour(isosurfaces=5, scalars='temperature')
iso.plot(scalars='temperature', cmap='hot')

Texture mapping examples

import pyvista as pv

# Create sphere and apply Earth texture
earth = pv.Sphere(radius=1.0, theta_resolution=50, phi_resolution=50)
earth_texture = pv.examples.download_earth_texture()

# Plot textured Earth
plotter = pv.Plotter()
plotter.add_mesh(earth, texture=earth_texture)
plotter.add_title("Earth with Day Texture")
plotter.show()

# Night texture version
night_texture = pv.examples.download_earth_night()
plotter = pv.Plotter()
plotter.add_mesh(earth, texture=night_texture)
plotter.add_title("Earth Night Lights")
plotter.show()

Cache management

import pyvista as pv

# Check cache directory
cache_dir = pv.examples.get_downloads_cache_dir()
print(f"Downloads cached in: {cache_dir}")

# List available examples
examples_dict = pv.examples.list_examples()
for category, examples in examples_dict.items():
    print(f"{category}: {len(examples)} examples")

# Load random example for exploration
random_data = pv.examples.load_random()
random_data.plot()

# Clean up cache if needed
# pv.examples.delete_downloads()  # Uncomment to delete all downloads

Install with Tessl CLI

npx tessl i tessl/pypi-pyvista

docs

data-processing.md

data-structures.md

examples.md

file-io.md

geometric-primitives.md

index.md

plotting.md

tile.json