Affinity

class Affinity(*transformations: HomogeneousTransformation)

An Affinity is any transformation composed of translations, rotations, uniform scales, stretches, shears, and reflections. Under direct affinity, reflections are not included.

Its matrix will look like the augmented matrix:

┏           ┓
┃  M     T  ┃
┃           ┃
┃  Z     1  ┃
┗           ┛

Where M is a 3x3 matrix with rank 3, T is a 3x1 vector, and Z is a 1x3 matrix containing all zeroes.

A CompositeHomogeneousTransformation is a CompositeTransformation closed under HomogeneousTransformation.

Parameters:

transformations – Transformations composing this transformation, supplied in the order of application (first-in, first-applied).

Attributes

transformations

Transformations composing this transformation, supplied in the order of application (first-in, first-applied).

Methods

apply

Apply this CompositeTransformation to a vector.

closed_under

Return True if composing a CompositeHomogeneousTransformation with other would result in creating another CompositeHomogeneousTransformation.

compute

Compute all Affinity transformations that might embed query in target.

inverse

The inverse HomogeneousTransformation of this one.

apply(vector: ndarray[3]) ndarray[3]

Apply this CompositeTransformation to a vector.

classmethod closed_under(other: Transformation | Type[Transformation]) bool

Return True if composing a CompositeHomogeneousTransformation with other would result in creating another CompositeHomogeneousTransformation.

classmethod compute(query: Shape, target: Shape, parameters: ShapeQueryParameters = ShapeQueryParameters(direct=True, indirect=True, indet_scale=1.0, indet_angle=0.0, indet_fit_max=False, indet_fit_uniform_scale=True)) List[HomogeneousTransformation]

Compute all Affinity transformations that might embed query in target.

Parameters:
  • query – The shape to embed in target.

  • target – The shape to embed query in.

  • parameters – The parameters used to calculate the transformations.

Returns:

The list of all transformations t such that t @ query <= target and isinstance(t, Affinity).

inverse()

The inverse HomogeneousTransformation of this one.

transformations

Transformations composing this transformation, supplied in the order of application (first-in, first-applied).