transform¶
The transform module.
- class nutils.transform.TransformItem(todims, fromdims)¶
Bases:
Singleton
Affine transformation.
Base class for transformations of the type \(x ↦ A x + b\).
- class nutils.transform.Matrix(linear, offset)¶
Bases:
TransformItem
Affine transformation \(x ↦ A x + b\), with \(A\) an \(n×m\) matrix, \(n≥m\)
- Parameters:
linear (
numpy.ndarray
) – The transformation matrix \(A\).offset (
numpy.ndarray
) – The offset \(b\).
- class nutils.transform.Square(linear, offset)¶
Bases:
Matrix
Affine transformation \(x ↦ A x + b\), with \(A\) square
- Parameters:
linear (
numpy.ndarray
) – The transformation matrix \(A\).offset (
numpy.ndarray
) – The offset \(b\).
- class nutils.transform.Identity(ndims)¶
Bases:
Square
Identity transformation \(x ↦ x\)
- Parameters:
ndims (
int
) – Dimension of \(x\).
- class nutils.transform.Index(ndims, index)¶
Bases:
Identity
Identity transform with index
This transformation serves as an element-specific or topology-specific index to form the basis of transformation lookups. Otherwise, the transform behaves like an identity.
- class nutils.transform.Updim(linear, offset, isflipped)¶
Bases:
Matrix
Affine transformation \(x ↦ A x + b\), with \(A\) an \(n×(n-1)\) matrix
- Parameters:
linear (
numpy.ndarray
) – The transformation matrix \(A\).offset (
numpy.ndarray
) – The offset \(b\).
- class nutils.transform.EvaluableTransformChain(args, todims, fromdims)¶
Bases:
Evaluable
The
Evaluable
equivalent of a transform chain.- static empty(_EvaluableTransformChain__dim)¶
Return an empty evaluable transform chain with the given dimension.
- Parameters:
dim (
int
) – The to and from dimensions of the empty transform chain.- Returns:
The empty evaluable transform chain.
- Return type:
- static from_argument(name, todims, fromdims)¶
Return an evaluable transform chain that evaluates to the given argument.
- Parameters:
- Returns:
The transform chain that evaluates to the given argument.
- Return type:
- property linear: Array¶
The linear transformation matrix of the entire transform chain. Shape
(todims,fromdims)
.- Type:
- property basis: Array¶
A basis for the root coordinate system such that the first
fromdims
vectors span the tangent space. Shape(todims,todims)
.- Type:
- apply(self, _EvaluableTransformChain__coords)¶
Apply this transform chain to the last axis given coordinates.
- Parameters:
coords (
nutils.evaluable.Array
) – The coordinates to transform with shape(...,fromdims)
.- Returns:
The transformed coordinates with shape
(...,todims)
.- Return type:
- index_with_tail_in(self, _EvaluableTransformChain__sequence)¶
Return the evaluable index of this transform chain in the given sequence.
- Parameters:
sequence (
nutils.transformseq.Transforms
) – The sequence of transform chains.- Returns:
nutils.evaluable.Array
– The index of this transform chain in the given sequence.EvaluableTransformChain
– The tail.
See also
nutils.transformseq.Transforms.index_with_tail()
the unevaluable version of this method