StructuredGrid.concatenate

StructuredGrid.concatenate#

StructuredGrid.concatenate(
other: StructuredGrid,
axis: int,
tolerance: float = 0.0,
) → StructuredGrid[source]#

Concatenate a structured grid to this grid.

Joins structured grids into a single structured grid. Grids must be of compatible dimension, and must be coincident along the seam. Grids must have the same point and cell data. Field data is ignored. The output keeps this grid’s offset.

Parameters:
otherpyvista.StructuredGrid

Structured grid to concatenate.

axisint

Axis along which to concatenate.

tolerancefloat, default: 0.0

Tolerance for point coincidence along joining seam.

Returns:
pyvista.StructuredGrid

Concatenated grid.

Examples#

Download Python source code | Download Jupyter notebook

Split a grid in half and join them.

>>> import numpy as np
>>> import pyvista as pv
>>> from pyvista import examples
>>> grid = examples.load_structured()
>>> voi_1 = grid.extract_subset([0, 80, 0, 40, 0, 1], boundary=True)
>>> voi_2 = grid.extract_subset([0, 80, 40, 80, 0, 1], boundary=True)
>>> joined = voi_1.concatenate(voi_2, axis=1)
>>> f'{grid.dimensions} same as {joined.dimensions}'
'(80, 80, 1) same as (80, 80, 1)'