Transformation

class tri3d.geometry.Transformation[source]

Base class for geometric transformations.

A transformation can can host a single or a batch of transformations as indicated by the the single attribute. Batched transformation support len and indexing.

Transformations can be chained together with the matrix multiplication (@) operator.

abstract property single: bool

Whether this is a single transformation or a batch.

__matmul__(other)[source]

Compose transformations together.

The rightmost operation is applied first.

Parameters:

other (Transformation)

Return type:

Transformation

abstractmethod apply(x)[source]

Apply transformation to given point or array of points.

The broadcasting rules between transformations and their inputs are as follows:

transform

input

output

brodcast

[]

[3]

[3]

single mapping

[]

[n,3]

[n,3]

broadcast transform

[n]

[3]

[n,3]

broadcst input

[n]

[n]

[n,3]

one-to-one mapping

Return type:

ndarray

abstractmethod inv()[source]

Return inverse transformation.

Return type:

Self