vispy.visuals.isoline module#

class vispy.visuals.isoline.IsolineVisual(vertices=None, tris=None, data=None, levels=None, color_lev=None, **kwargs)#

Bases: LineVisual

Isocurves of a tri mesh with data at vertices at different levels.

Parameters:
verticesndarray, shape (Nv, 3) | None

Vertex coordinates.

trisndarray, shape (Nf, 3) | None

Indices into the vertex array.

datandarray, shape (Nv,) | None

scalar at vertices

levelsndarray, shape (Nlev,) | None

The levels at which the isocurve is constructed from “data”.

color_levColor, tuple, colormap name or array

The color to use when drawing the line. If an array is given, it must be of shape (Nlev, 4) and provide one rgba color by level.

**kwargsdict

Keyword arguments to pass to LineVisual.

property color#
property data#

The mesh data

property levels#

The threshold at which the isocurves are constructed from the data.

set_color(color)#

Set the color

Parameters:
colorinstance of Color

The color to use.

set_data(vertices=None, tris=None, data=None)#

Set the data

Parameters:
verticesndarray, shape (Nv, 3) | None

Vertex coordinates.

trisndarray, shape (Nf, 3) | None

Indices into the vertex array.

datandarray, shape (Nv,) | None

scalar at vertices

vispy.visuals.isoline.iso_mesh_line(vertices, tris, vertex_data, levels)#

Generate an isocurve from vertex data in a surface mesh.

Parameters:
verticesndarray, shape (Nv, 3)

Vertex coordinates.

trisndarray, shape (Nf, 3)

Indices of triangular element into the vertices array.

vertex_datandarray, shape (Nv,)

data at vertex.

levelsndarray, shape (Nl,)

Levels at which to generate an isocurve

Returns:
linesndarray, shape (Nvout, 3)

Vertex coordinates for lines points

connectsndarray, shape (Ne, 2)

Indices of line element into the vertex array.

vertex_level: ndarray, shape (Nvout,)

level for vertex in lines

Notes

Uses a marching squares algorithm to generate the isolines.