10.1.4.15. Transformation

Module to implement transformations like scale, rotation and translation.

For resources on transformations see this section.

class Patro.GeometryEngine.Transformation.AffineTransformation(obj, transformation_type=<TransformationType.Generic: 9>)[source]

Bases: Patro.GeometryEngine.Transformation.Transformation

classmethod RotationAt(center, angle)[source]
classmethod Translation(vector)[source]
matrix_part
translation_part
class Patro.GeometryEngine.Transformation.AffineTransformation2D(obj, transformation_type=<TransformationType.Generic: 9>)[source]

Bases: Patro.GeometryEngine.Transformation.AffineTransformation

classmethod Rotation(angle)[source]
classmethod Scale(x_scale, y_scale)[source]
classmethod Screen(y_height)[source]
__dimension__ = 2
__mul__(obj)[source]

Return self * obj composition.

__size__ = 3
_check_type()[source]
exception Patro.GeometryEngine.Transformation.IncompatibleArrayDimension[source]

Bases: ValueError

class Patro.GeometryEngine.Transformation.Transformation(obj, transformation_type=<TransformationType.Generic: 9>)[source]

Bases: object

classmethod Identity()[source]
__dimension__ = None
__imul__(obj)[source]

Set transformation to obj * self composition.

__init__(obj, transformation_type=<TransformationType.Generic: 9>)[source]

Initialize self. See help(type(self)) for accurate signature.

__mul__(obj)[source]

Return self * obj composition.

__repr__()[source]

Return repr(self).

__size__ = None
_check_type()[source]
_mul_type(obj)[source]
array
dimension
is_identity
same_dimension(other)[source]
size
to_list()[source]
type
class Patro.GeometryEngine.Transformation.Transformation2D(obj, transformation_type=<TransformationType.Generic: 9>)[source]

Bases: Patro.GeometryEngine.Transformation.Transformation

classmethod Parity()[source]
classmethod Rotation(angle)[source]
classmethod Scale(x_scale, y_scale=None)[source]
classmethod XReflection()[source]
classmethod YReflection()[source]
__dimension__ = 2
__size__ = 2
_check_type()[source]
classmethod check_matrix_type(matrix)[source]
classmethod type_for_scale(x_scale, y_scale)[source]
class Patro.GeometryEngine.Transformation.TransformationType[source]

Bases: enum.Enum

An enumeration.

Generic = 9
Identity = 1
Parity = 4
Rotation = 7
Scale = 2
Shear = 3
Translation = 8
XParity = 5
YParity = 6