Skip to content

RotationUtil

Implementation of the rotation utility

RotationUtil

Canonical path: Utils.RotationUtil.RotationUtil

Class used to describe the rotation around the three axes (X,Y,Z) in order to transform a geometry from local to global coordinate system or the other way around.

Often used in context of transforming a bending shape (rebar or mesh) from/to its local coordinate system.

angle_x property

angle_x: float

Rotation angle around the X axis (in degrees)

Returns:

  • float

    Rotation angle around the X axis (in degrees)

angle_y property

angle_y: float

Rotation angle around the Y axis (in degrees)

Returns:

  • float

    Rotation angle around the Y axis (in degrees)

angle_z property

angle_z: float

Rotation angle around the Z axis (in degrees)

Returns:

  • float

    Rotation angle around the Z axis (in degrees)

__init__

__init__(angle_x: float, angle_y: float, angle_z: float)

Construct the object by setting all three angles. The angles are given in degrees.

Parameters:

  • angle_x (float) –

    Rotation angle (degree) around the local x axis

  • angle_y (float) –

    Rotation angle (degree) around the local y axis

  • angle_z (float) –

    Rotation angle (degree) around the local z axis

__repr__

__repr__() -> str

create a string from the object data

Returns:

  • str

    string with the object data

get_rotation_matrix

get_rotation_matrix(axis_point: Point3D = Point3D()) -> Matrix3D

Get a 3D transformation matrix (4x4) describing the rotation around the given point by all three angles: x, y and z.

Parameters:

  • axis_point (Point3D, default: Point3D() ) –

    Rotation point. Defaults to the origin (0,0,0).

Returns:

  • Matrix3D

    Transformation matrix describing the rotation

inverse

inverse() -> RotationUtil

Get the inverse rotation, which can be used to transform from global to local coordinate system if the original rotation is used to transform from local to global coordinate system (or the other way around).

Returns:

  • RotationUtil

    RotationUtil object with the inverse angles

Placeholder