pyvista.core._validation.validate.validate_transform4x4

pyvista.core._validation.validate.validate_transform4x4#

validate_transform4x4(
transform: TransformLike,
/,
*,
must_be_finite: bool = True,
name: str = 'Transform',
) NumpyArray[float][source]#

Validate transform-like input as a 4x4 ndarray.

This function supports inputs with a 3x3 or 4x4 shape. If the input is 3x3, the array is padded using a 4x4 identity matrix.

Parameters:
transformTransformLike

Transformation matrix as a 3x3 or 4x4 array or vtk matrix, or a SciPy Rotation instance.

Transformation matrix as a 3x3 or 4x4 array, 3x3 or 4x4 vtkMatrix, or as a vtkTransform.

must_be_finitebool, default: True

Check if all elements of the array are finite, i.e. not infinity and not Not a Number (NaN).

namestr, default: “Transform”

Variable name to use in the error messages if any of the validation checks fail.

Returns:
np.ndarray

Validated 4x4 transformation matrix.

See also

validate_transform3x3

Similar function for 3x3 transforms.

validate_array

Generic array validation function.