vispy.visuals.tube module#

class vispy.visuals.tube.TubeVisual(points, radius=1.0, closed=False, color='purple', tube_points=8, shading='smooth', vertex_colors=None, face_colors=None, mode='triangles')#

Bases: MeshVisual

Displays a tube around a piecewise-linear path.

The tube mesh is corrected following its Frenet curvature and torsion such that it varies smoothly along the curve, including if the tube is closed.

Parameters:
pointsndarray

An array of (x, y, z) points describing the path along which the tube will be extruded.

radiusfloat | ndarray

The radius of the tube. Use array of floats as input to set radii of points individually. Defaults to 1.0.

closedbool

Whether the tube should be closed, joining the last point to the first. Defaults to False.

colorColor | ColorArray

The color(s) to use when drawing the tube. The same color is applied to each vertex of the mesh surrounding each point of the line. If the input is a ColorArray, the argument will be cycled; for instance if ‘red’ is passed then the entire tube will be red, or if [‘green’, ‘blue’] is passed then the points will alternate between these colours. Defaults to ‘purple’.

tube_pointsint

The number of points in the circle-approximating polygon of the tube’s cross section. Defaults to 8.

shadingstr | None

Same as for the MeshVisual class. Defaults to ‘smooth’.

vertex_colors: ndarray | None

Same as for the MeshVisual class.

face_colors: ndarray | None

Same as for the MeshVisual class.

modestr

Same as for the MeshVisual class. Defaults to ‘triangles’.