Skip to content

mkit.ops.transform

denorm_transformation

denorm_transformation(mesh: Any) -> F44

Applies a denormalization transformation to the given mesh.

This function converts the input mesh to a PyVista PolyData object, then computes a transformation matrix that scales and translates the mesh based on its length and center.

Parameters:

  • mesh (Any) –

    The input mesh to be transformed. It can be of any type that can be converted to a PyVista PolyData object.

Returns:

  • F44

    A 4x4 transformation matrix that scales and translates the mesh.

norm_transformation

norm_transformation(mesh: Any) -> F44

Computes the normalization transformation matrix for a given mesh.

This function calculates the inverse of the denormalization transformation matrix for the provided mesh and returns it as the normalization transformation matrix.

Parameters:

  • mesh (Any) –

    The mesh object for which the normalization transformation matrix is to be computed.

Returns:

  • F44

    The normalization transformation matrix.

normalize

normalize(
    mesh: Any,
    *,
    transform_all_input_vectors: bool = False,
    inplace: bool = False
) -> PolyData