pogona.Transformation

class pogona.Transformation(translation: numpy.ndarray = array([0, 0, 0]), rotation: numpy.ndarray = array([0, 0, 0]), scaling: numpy.ndarray = array([1, 1, 1]), matrix: Optional[numpy.ndarray] = None, direction_matrix: Optional[numpy.ndarray] = None, rotation_order: str = 'XYZ')[source]

Bases: object

Attributes

direction_matrix

inverse_direction_matrix

inverse_matrix

matrix

rotation

scaling

translation

was_set_from_matrix

If true, this transformation was initialized with a given matrix, which means we don't know the translation, rotation, or scale for sure.

__init__(translation: numpy.ndarray = array([0, 0, 0]), rotation: numpy.ndarray = array([0, 0, 0]), scaling: numpy.ndarray = array([1, 1, 1]), matrix: Optional[numpy.ndarray] = None, direction_matrix: Optional[numpy.ndarray] = None, rotation_order: str = 'XYZ')[source]

Scaling is applied first, then rotation, then translation!

Parameters
  • translation

  • rotation – Rotation vector in radians.

  • scaling

  • matrix – Instead of translation, rotation and scaling, provide combined matrix instead

  • direction_matrix – Must be given together with matrix.

  • rotation_order – Order for computing the rotation matrix. Blender’s default is also ‘XYZ’.

Methods

__init__([translation, rotation, scaling, ...])

Scaling is applied first, then rotation, then translation!

apply_inverse_to_direction(vec)

apply_inverse_to_directions(vecs)

apply_inverse_to_point(point)

apply_inverse_to_points(points)

apply_to_direction(vec)

apply_to_directions(vecs)

apply_to_point(point)

apply_to_points(points)

apply_to_transformation(other)

Works as if you were to first apply other to a point, then this transformation afterwards.

__init__(translation: numpy.ndarray = array([0, 0, 0]), rotation: numpy.ndarray = array([0, 0, 0]), scaling: numpy.ndarray = array([1, 1, 1]), matrix: Optional[numpy.ndarray] = None, direction_matrix: Optional[numpy.ndarray] = None, rotation_order: str = 'XYZ')[source]

Scaling is applied first, then rotation, then translation!

Parameters
  • translation

  • rotation – Rotation vector in radians.

  • scaling

  • matrix – Instead of translation, rotation and scaling, provide combined matrix instead

  • direction_matrix – Must be given together with matrix.

  • rotation_order – Order for computing the rotation matrix. Blender’s default is also ‘XYZ’.

apply_inverse_to_direction(vec: numpy.ndarray)[source]
apply_inverse_to_directions(vecs: Sequence[numpy.ndarray])[source]
apply_inverse_to_point(point: numpy.ndarray)[source]
apply_inverse_to_points(points: Sequence[numpy.ndarray]) numpy.ndarray[source]
apply_to_direction(vec: numpy.ndarray)[source]
apply_to_directions(vecs: Sequence[numpy.ndarray]) numpy.ndarray[source]
apply_to_point(point: numpy.ndarray)[source]
apply_to_points(points: Sequence[numpy.ndarray]) numpy.ndarray[source]
apply_to_transformation(other: pogona.transformation.Transformation)[source]

Works as if you were to first apply other to a point, then this transformation afterwards.

property direction_matrix: numpy.ndarray
property inverse_direction_matrix: numpy.ndarray
property inverse_matrix: numpy.ndarray
property matrix: numpy.ndarray
property rotation: numpy.ndarray
property scaling: numpy.ndarray
property translation: numpy.ndarray
property was_set_from_matrix

If true, this transformation was initialized with a given matrix, which means we don’t know the translation, rotation, or scale for sure.