NoDistortTransform

class ipkiss3.all.NoDistortTransform

A homothetic transformation that does not distort the item it is applied to (angle conservation)

The transform is defined by - a mirror around the x-axis - a scaling with respect to the origin - a rotation around the origin - a translation

it is also possible to set absolute magnification and rotation, which means that subsequent transformations will not affect the angle and size any further

The specific transformations i3.Rotation, i3.Translation, i3.Magnification, i3.VMirror, i3.HMirror and i3.CMirror all reduce to a NoDistortTransform.

If the rotation, magnification or point mirror center is not the origin, or the mirror axis does not pass through the origin, then the translation of NoDistortTransform is calculated so that the transformation is made relative to the origin and then the correct translation is done.

When adding specific transformations, e.g. i3.Rotation(…) + i3.Magnification(…), a NoDistortTransform results as well. IPKISS ensures the translation is correctly set in this case.

Direct use of NoDistortTransform for combined transformations is dangerous and advised against, since you have to calculate the translation yourself. NoDistortTransform will raise an error if you try to set more than one of magnification_center, rotation_center, mirror_center, mirror_plane_x or mirror_plane_y is not (through) the origin

Parameters:
mirror_center: Coord2, optional

point mirror center, is incorporated in the default translation

mirror_plane_y: float, optional

y ordinate of x axis to mirror around

mirror_plane_x: float, optional

x abscissa of y axis to mirror around

magnification_center: Coord2, optional

magnification center, will be incorporated in the default translation

rotation_center: Coord2, optional

rotation center, will be incorporated in the default translation

absolute_rotation: ( bool, bool_ or int ), optional
absolute_magnification: ( bool, bool_ or int ), optional
v_mirror: ( bool, bool_ or int ), optional
magnification: float, optional
rotation: optional

the rotation around the origin

translation: Coord2, optional

translation, should include any translation required to represent a transformation which is not around the origin

apply_to_coord(coord)

applies transformation to a coordinate

reverse_on_coord(coord)

applies reverse transformation to a coordinate

apply_to_array(coords)

internal use: applies transformation to a numpy array

reverse_on_array(coords)

internal use: applies reverse transformation to a numpy array

apply_to_coord3(coord)

applies transformation to a coordinate

reverse_on_coord3(coord)

applies reverse transformation to a coordinate

apply_to_array3(coords)

internal use: applies transformation to a numpy array

reverse_on_array3(coords)

internal use: applies reverse transformation to a numpy array

apply_to_angle_deg(angle)

applies transformation to an absolute angle (degrees)

reverse_on_angle_deg(angle)

applies reverse transformation to an absolute angle (degrees)

apply_to_angle_rad(angle)

applies transformation to an absolute angle (radians)

reverse_on_angle_rad(angle)

applies reverse transformation to an absolute angle (radians)

apply_to_length(length)

applies transformation to a distance

reverse_on_length(length)

applies reverse transformation to a distance

is_identity()

returns True if the transformation does nothing

is_isometric()

returns True if the transformation conserves angles and distances

is_homothetic()

returns True if the transformation conserves angles

is_orthogonal()

returns True if the transformation does only rotate on 90degree angles

is_octogonal()

returns True if the transformation does only rotate on 45degree angles

id_string()

gives a hash of the transform (for naming purposes)