Home

If you're new to Python
and VPython: Introduction

A VPython tutorial

Pictures of 3D objects

What's new in VPython 6

VPython web site
VPython license
Python web site
Math module (sqrt etc.)
Numpy module (arrays)

 
helix
helix

This is documentation for Classic VPython (VPython 6), which continues to be available but is no longer supported. See vpython.org for information on installing VPython 7 or using GlowScript VPython. Documentation is available at glowscript.org by clicking Help.

The following statement will display a helix that is parallel to the x axis:

spring = helix(pos=(0,2,1), axis=(5,0,0), radius=0.5)

The helix object has the following attributes and default values: pos (0,0,0), x (0), y(0), z(0), axis (1,0,0), length (1), radius (1), coils (5), thickness (radius/20), color (1,1,1) which is color.white, red (1), green (1), blue (1), material, and up (0,1,0)

At present, setting just the x, y, or z component of the axis of a helix does not update its appearance; it is necessary to assign a complete vector to the axis of the helix.

Note that the pos attribute for cylinder, arrow, cone, pyramid, and helix corresponds to one end of the object, whereas for a box, sphere, or ring it corresponds to the center of the object.

Currently it is not possible to specify the opacity of a helix object, which is based on the curve object.

See description of Additional Attributes available for all 3D display objects.