Channels¶
This page contains classes defined in hakowan.channel module.
Visual channel models for positions, glyphs, fields, and maps.
Channel
dataclass
¶
Position
dataclass
¶
Bases: Channel
Map a geometry-dimensional attribute to rendered positions.
Without this channel, source mesh vertices supply positions. Use it for deformed or alternate position attributes.
Attributes:
| Name | Type | Description |
|---|---|---|
data |
AttributeLike
|
The attribute used to encode the position field. |
Source code in hakowan/grammar/channel/channel.py
Normal
dataclass
¶
Bases: Channel
Map a geometry-dimensional attribute to surface normals.
Without this channel, Hakowan computes normals from geometry.
Attributes:
| Name | Type | Description |
|---|---|---|
data |
AttributeLike
|
The attribute used to encode the normal field. |
Source code in hakowan/grammar/channel/channel.py
Size
dataclass
¶
Bases: Channel
Map a scalar attribute or constant to point/curve glyph size.
world values are radii in input geometry units. scene values are
visible diameter fractions of the compiled scene bounding-box diagonal.
screen values are visible diameters in output pixels.
Attributes:
| Name | Type | Description |
|---|---|---|
data |
AttributeLike | float
|
Attribute or constant size value. |
space |
Literal['world', 'scene', 'screen']
|
World, scene-relative, or screen-pixel sizing. |
Source code in hakowan/grammar/channel/channel.py
VectorField
dataclass
¶
Bases: Channel
Render a vertex- or facet-domain vector attribute as curve glyphs.
The vector must have the same dimension as the source geometry.
Attributes:
| Name | Type | Description |
|---|---|---|
data |
AttributeLike
|
The attribute used to encode the vector field. |
refinement_level |
int
|
The refinement level of the vector field. This parameter is used to control the density of the vector field. The default value is 0. |
style |
CurveStyle | None
|
The style of the vector field. If None, the default style will be used. |
end_type |
Literal['point', 'arrow', 'flat']
|
The type of the vector field end.
|
normalize |
bool
|
If True, every vector is rescaled to unit length so
that all arrows have the same length and only encode direction.
The magnitude is freed up to be mapped to another channel (e.g.
|
Source code in hakowan/grammar/channel/channel.py
Covariance
dataclass
¶
Bases: Channel
Map per-point 3x3 covariance data to anisotropic point glyphs.
full=True interprets the attribute as covariance; otherwise values are
its square-root transform M where covariance is M @ M.T.
Attributes:
| Name | Type | Description |
|---|---|---|
data |
AttributeLike
|
The attribute used to encode the covariance matrix. |
full |
bool
|
(bool): If True, the full covariance matrix is stored in the attribute. If False, its "square root", M, is stored. The full covariance matrix is ∑ := M @ M^T. The matrix M represenst the stretch and rotation transform applied on each mark. |
Source code in hakowan/grammar/channel/channel.py
Shape
dataclass
¶
Bases: Channel
Select and optionally orient sphere, disk, or cube point glyphs.
Attributes:
| Name | Type | Description |
|---|---|---|
base_shape |
Literal['sphere', 'disk', 'cube']
|
The base shape used to represent a point.
The default value is |
orientation |
AttributeLike | None
|
The attribute used to encode the normal orientation of the shape. If None, orientation will be identity (i.e. normal along z-axis). |
Source code in hakowan/grammar/channel/channel.py
BumpMap
dataclass
¶
Bases: Channel
Perturb surface shading normals with a scalar bump texture.
Attributes:
| Name | Type | Description |
|---|---|---|
texture |
TextureLike
|
The texture used to encode the bump map. |
scale |
float
|
The scale of the bump map. The default value is 1.0. |
Source code in hakowan/grammar/channel/channel.py
NormalMap
dataclass
¶
Bases: Channel
Perturb surface shading normals with a tangent-space normal texture.
Attributes:
| Name | Type | Description |
|---|---|---|
texture |
TextureLike
|
The texture used to encode the normal map. |