Transform¶
This page contains classes defined in hakowan.transform
module.
Transform
dataclass
¶
Transform is the base class of all transforms.
Source code in hakowan/grammar/transform/transform.py
__imul__(other)
¶
In place update by applying another transform after the current transform.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
other |
Transform
|
The transform to apply after the current transform. |
required |
Source code in hakowan/grammar/transform/transform.py
__mul__(other)
¶
Apply another transform, other
, after the current transform.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
other |
Transform
|
The other transform. |
required |
Returns: A new transform that is the composition of the current transform and other
.
Source code in hakowan/grammar/transform/transform.py
Filter
dataclass
¶
Bases: Transform
Filter data based on a condition.
Attributes:
Name | Type | Description |
---|---|---|
data |
AttributeLike | None
|
The attribute to filter on. If None, the vertex position is used. |
condition |
Callable
|
A callable that takes a single argument, the value of the attribute, and returns a boolean indicating whether the data should be kept. |
Source code in hakowan/grammar/transform/transform.py
UVMesh
dataclass
¶
Bases: Transform
Extract UV mesh from data.
Attributes:
Name | Type | Description |
---|---|---|
uv |
AttributeLike | None
|
The attribute defining the UV coordinates. If None, automatically deetect the UV attribute from the data. |
Source code in hakowan/grammar/transform/transform.py
Affine
dataclass
¶
Bases: Transform
Apply affine transformation to data.
Attributes:
Name | Type | Description |
---|---|---|
matrix |
ArrayLike
|
The 4x4 affine matrix to apply. |
Source code in hakowan/grammar/transform/transform.py
Compute
dataclass
¶
Bases: Transform
Compute new attributes from the current data frame.
Attributes:
Name | Type | Description |
---|---|---|
x |
str | None
|
Extract the x coordinate as an attribute. |
y |
str | None
|
Extract the y coordinate as an attribute. |
z |
str | None
|
Extract the z coordinate as an attribute. |
normal |
str | None
|
Compute the normal vector field as an attribute. |
vertex_normal |
str | None
|
Compute the vertex normal vector field as an attribute. |
facet_normal |
str | None
|
Compute the facet normal vector field as an attribute. |
component |
str | None
|
Compute connected component ids. |
Source code in hakowan/grammar/transform/transform.py
Explode
dataclass
¶
Bases: Transform
Explode data into multiple pieces.
Attributes:
Name | Type | Description |
---|---|---|
pieces |
AttributeLike
|
The attribute defining the pieces. |
magnitude |
float
|
The magnitude of the displacement. |
Source code in hakowan/grammar/transform/transform.py
Norm
dataclass
¶
Bases: Transform
Compute the row-wise norm of a given vector attribute.
Attributes:
Name | Type | Description |
---|---|---|
data |
AttributeLike
|
The vector attribute to compute the norm on. |
norm_attr_name |
str
|
The name of the output norm attribute. |
order |
int
|
The order of the norm. Default is 2, which is the L2 norm. |
Source code in hakowan/grammar/transform/transform.py
Boundary
dataclass
¶
Bases: Transform
Compute the boundary of a mesh.
Attributes:
Name | Type | Description |
---|---|---|
attributes |
list[str]
|
The attributes to take into account when computing the boundary. i.e. discontinuities in these attributes will be considered as boundaries. |