Skip to main content
`Ctrl`+`K`

# 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:
    points ndarray

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

    radius float | ndarray

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

    closed bool

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

    color Color | 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_points int

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

    shading str | 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.

    mode str

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