# Examples from pyvista.DataObjectFilters.transform
# =================================================

# Translate a mesh by `(50, 100, 200)`.
import numpy as np
from pyvista import examples
mesh = examples.load_airplane()

# Here a 4x4 `numpy.ndarray` is used, but any `TransformLike`
# is accepted.
transform_matrix = np.array(
    [
        [1, 0, 0, 50],
        [0, 1, 0, 100],
        [0, 0, 1, 200],
        [0, 0, 0, 1],
    ]
)
transformed = mesh.transform(transform_matrix, inplace=False)
transformed.plot(show_edges=True)

# ----------------------------------------------------------------------
# Generated by sphinx-examples-as-code https://github.com/pyvista/sphinx-examples-as-code
