alias_api.AlTM
- class alias_api.AlTM
Bases:
pybind11_objectBasic Interface to Alias transformation matrix.
This class encapsulates the functionality for creating, manipulating and deleting Alias 4x4 transformation matrices.
Tranformation matrices are used to perform linear transformations of a vector. Composite transformations are performed by multiplying the individual transformations together.
- The matrix is ordered as AlTM[y][x]:
0,0 0,1 0,2 0,3 1,0 1,1 1,2 1,3 2,0 2,1 2,2 2,3 3,0 3,1 3,2 3,3
The transformation matrix usually takes the form:
- TM = | r00 r01 r02 0 |
- r10 r11 r12 0 |r20 r21 r22 0 |tx0 ty0 tz0 1 |
where tx0, ty0, tz0 are the aggregrate translations and r(xy) is the aggregate product of rotations, scales and shears.
A point is transformed by considering the point to be a row vector of 4 elements and then post multiplying by the transformation matrix.
[x’ y’ z’ w’] = [x y z w] | 00 01 02 03 | | 10 11 12 13 | | 20 21 22 23 | | 30 31 32 33 |
If the w component is not specified, it is assumed to have a value of 1.
- assign(self: alias_api.AlTM, row: SupportsInt, col: SupportsInt, value: SupportsFloat) None
Set the AlTM matrix value at the row and column index.
- decompose(self: alias_api.AlTM) tuple[int, Annotated[list[float], 'FixedSize(3)'], Annotated[list[float], 'FixedSize(3)'], Annotated[list[float], 'FixedSize(3)'], Annotated[list[float], 'FixedSize(3)']]
Decompose the transform matrix into translate, rotate, scale and shear vectors.
- static diagonal(d0: SupportsFloat, d1: SupportsFloat, d2: SupportsFloat, d3: SupportsFloat) alias_api.AlTM
Return a zero matrix with diagonal values of ‘d’.
- get_tm(self: alias_api.AlTM) tuple[int, Annotated[list[Annotated[list[float], 'FixedSize(4)']], 'FixedSize(4)']]
Return the contents of the AlTM into a 4x4 array.
- static identity() alias_api.AlTM
Return the identity matrix.
- inverse(self: alias_api.AlTM) alias_api.AlTM
Return the inverse of the matrix.
- static rotate(x: SupportsFloat, y: SupportsFloat, z: SupportsFloat, angle: SupportsFloat) alias_api.AlTM
Return a transformation matrix to rotate counterclockwise about the axis (x, y, z).
- static rotate_x(rx: SupportsFloat) alias_api.AlTM
Return a transformation matrix to rotate about the x-axis.
- static rotate_y(ry: SupportsFloat) alias_api.AlTM
Return a transformation matrix to rotate about the y-axis.
- static rotate_z(rz: SupportsFloat) alias_api.AlTM
Return a transformation matrix to rotate about the z-axis.
- static scale(d: SupportsFloat) alias_api.AlTM
Return a transformation matrix to scale a point (x, y, z) by a constant with a value of ‘d’.
- static scale_nonp(sx: SupportsFloat, sy: SupportsFloat, sz: SupportsFloat) alias_api.AlTM
Return a transformation matrix to non-proportionally scale a point (x, y, z) by ‘sx’ in the x-axis, ‘sy’ in the y-axis, and ‘sz’ in the z-axis.
- set_tm(self: alias_api.AlTM, tm: Annotated[collections.abc.Sequence[Annotated[collections.abc.Sequence[SupportsFloat], 'FixedSize(4)']], 'FixedSize(4)']) int
Copies the given 4x4 transform matrix into this AlTM.
- trans_normal(self: alias_api.AlTM, x: SupportsFloat, y: SupportsFloat, z: SupportsFloat) tuple[int, float, float, float]
Using the transformation matrix, transform the normal (x,y,z).
- trans_point(*args, **kwargs)
Overloaded function.
trans_point(self: alias_api.AlTM, d: typing.Annotated[collections.abc.Sequence[typing.SupportsFloat], “FixedSize(4)”]) -> tuple[int, typing.Annotated[list[float], “FixedSize(4)”]]
Return the resulting point by transforming the point ‘d’ using this matrix.
trans_point(self: alias_api.AlTM, x: typing.SupportsFloat, y: typing.SupportsFloat, z: typing.SupportsFloat, w: typing.SupportsFloat) -> tuple[int, float, float, float, float]
Using the transformation matrix, transform the point (x,y,z,w).
trans_point(self: alias_api.AlTM, x: typing.SupportsFloat, y: typing.SupportsFloat, z: typing.SupportsFloat) -> tuple[int, float, float, float]
Using the transformation matrix, transform the point (x,y,z,1).
- trans_vector(self: alias_api.AlTM, x: SupportsFloat, y: SupportsFloat, z: SupportsFloat) tuple[int, float, float, float]
Using the transformation matrix, transform the vector (x,y,z,1).
- static translate(arg0: SupportsFloat, arg1: SupportsFloat, arg2: SupportsFloat) alias_api.AlTM
Return a transformation matrix to translate a point (x, y, z) by (tx, ty, tz).
- transpose(self: alias_api.AlTM) alias_api.AlTM
Return the transpose of the matrix.
- static zero() alias_api.AlTM
Return the zero matrix.