pygfx.materials.LineMaterial¶
- class pygfx.materials.LineMaterial(color=(1, 1, 1, 1), thickness=2.0, color_mode='auto', map=None, map_interpolation='linear', aa=True, **kwargs)¶
Bases:
MaterialBasic line material.
- Parameters:
color (Color) – The uniform color of the line (used depending on the
color_mode).thickness (float) – The line thickness expressed in logical pixels.
color_mode (enum or str) – The mode by which the line is coloured. Default ‘auto’.
map (Texture) – The texture map specifying the color for each texture coordinate. Opional.
map_interpolation (str) – The method to interpolate the color map. Either ‘nearest’ or ‘linear’. Default ‘linear’.
aa (bool) – Whether or not the line should be anti-aliased. Aliasing gives prettier results, but may affect performance for very large datasets. Default True.
kwargs (Any) – Additional kwargs will be passed to the
material base class.
Examples
- property color¶
The uniform color of the line.
- property color_is_transparent¶
Whether the color is (semi) transparent (i.e. not fully opaque).
- property aa¶
Whether or not the line should be anti-aliased. Aliasing gives prettier results, but may affect performance for very large datasets. Default True.
- property color_mode¶
The way that color is applied to the mesh.
auto: switch between uniform and vertex_map, depending on whether map is set.
uniform: use the material’s color property for the whole mesh.
vertex: use the geomerty colors buffer, one color per vertex.
face: use the geomerty colors buffer, one color per line-piece.
vertex_map: use the geometry texcoords buffer to sample (per vertex) in the material’s
maptexture.faces_map: use the geometry texcoords buffer to sample (per line-piece) in the material’s
maptexture.
- property thickness¶
The line thickness expressed in logical pixels.
- property map¶
The texture map specifying the color for each texture coordinate. Can be None. The dimensionality of the map can be 1D, 2D or 3D, but should match the number of columns in the geometry’s texcoords.
- property map_interpolation¶
The method to interpolate the colormap. Either ‘nearest’ or ‘linear’.