This is a description of some of the commands available in KnotPlot. Commands may be abbreviated
to any length. However it is safer to never abbreviate a command to less than four
characters. Commands are guaranteed to be unambiguous if this general rule is followed.
Command arguments that take on numerical values may be set in the same way as parameters (except
without an equal sign). See the explanation at the beginning of that
Click on one of the following subsection names to go to that subsection. To
return to the top of the page, click on one of the arrows pointing upwards.
[General purpose commands]
[Loading and saving knots and links]
[Creating new knots and links]
[Relaxing knots and links]
[Exporting surface models]
General purpose commands
Reads the file filename and executes the commands found there. Same as the
Sends the string shell-command to the shell to be executed there.
message text1 [text2]
Pops up an alert box with message written in it, and two buttons text1 and
parameter start stop steps [linear | log]
Animates parameter from start to stop in steps increments.
Defaults to linear. The
has several examples of the use of
a trefoil relaxing.
a figure-8 knot relaxing.
the knot 6.3 relaxing.
the knot 7.1 relaxing.
made on Sep 8, 1994.
made on Oct 7, 1994.
made on Oct 7, 1994.
something mangling (see
An example of a 4D knot.
Sets the mouse cursor used in the view window. The argument what can be either an integer
or a string. The following values are permitted for integer settings:
If what is a non-integer, a 2-bit (four colour) cursor is read from the file
what.cur. A program,
is included in the resource directory for converting raw PPM files to the '.cur' format. Check
to find out more details.
- 0 Sets the cursor to the default.
- 1 Sets the cursor to a small plus sign.
Same as the
With no arguments, prints the current binding of the function keys. With one argument, prints the
binding for that key. Otherwise the function key number is bound to action. See
the demo files and the
file for examples of use.
Prints out some useful information about the current knot, such as the number of beads and
components, and the extent in the three orthogonal directions.
except on SGIs, where there is a difference but not a very interesting one.
This command does nothing at all.
- panel psout
Outputs a Postscript representation of the current control panel to the file filename.eps.
If filename is omitted, the output is written to the file cpanel.eps.
- panel set
Sets the control panel to which. The same effect can be achieved using the
to find out how the control panels are numbered.
Prints the current settings of all parameters.
Prints the value of any parameters starting with the string name.
If directory is omitted, this command prints the current read and write paths. See
for more information.
Pauses execution for number seconds. This is only useful for sessions run from a script.
Same as the
Reads the file filename and executes the commands found there. Same as the < command.
It is useful because there are certain contexts where
will work but < will not.
Similar to the
command except uses shifted function keys (using the right shift key).
Sets the random number seed to value.
Similar to the
command except uses shifted function keys (using the left shift key).
Without an argument, turns off drawing of all specials. Otherwise, what may be one of the
- axes --- Turns on drawing of 3D coordinate axes.
- backdrop --- Turns on backdrop.
- command --- To be explained elsewhere.
- intro --- Draws the intro screen.
- labels --- Turns on drawing of bead labels.
- monitor --- Draws the text normally seen in the monitor window in the view window as
well (doesn't really work at all).
- sphere --- Turns on drawing of
- spin --- Turns on drawing of spin plane (see the
If you want to draw more than one special at a time, append the keywords with a '+' sign.
Appending a '-' sign will turn off that special without affecting the drawing of other specials.
Appending a ' ' sign will toggle the special without affecting other specials. Look
for examples of usage. The spin plane, labels, and axes may also be turned on and off with the
radio button in the main
and the utility sphere via the
Prints out some execution info.
Same as the
Prints out some useful information, including how to find the KnotPlot home directory (the root of
) and the
Loading and saving knots and links
Allocates enough memory for nbeads number of beads.
Prints out the coordinates of every bead in the current knot.
Same as the above command except this outputs to the file filename. These files are made
for easy reading by other software. A knot file written with this command may be read by using the
Loads a knot or link from the catalogue, selected at random. Very useful for demos.
Same as above, but loads a knot with n components.
- knot number
Loads the nth knot or link from the tables. The valid range for n is
from 1 to 384.
- knot special
Loads a knot at random from the
The special collection contains several oddities as well as a few composite knots.
Loads a knot from the file filename.
- load combine
Same as above except a new link is created by combining the current knot and the knot in the file
filename (i.e. creates the union of the two knots or links).
- load sum
Same as above except a new knot is formed by creating the direct sum of the current knot and the
knot in file filename. This command uses the
commands to move everything into the correct position. If you find you don't like the results it
gives, you may have to do these operations as well as
yourself. One limitation is that KnotPlot expects both summands to be
Saves the current knot or link to the file filename. If format is omitted, the
file is saved in the format given by the current value of
. If format is an integer, then that value is used as the save format and sformat
is ignored. Otherwise, if format is float (or LOCF), short (or
LOCS), char (or LOCC), ascii (or raw), ked, or
ming then the file is saved with that format instead of the format specified by
sformat (see the description of sformat). Including the second parameter is useful
for temporarily overriding the default save format.
Generates a ``knot zoo'' of size sizeXsize starting with the knot number
start in the
If size is omitted, it will default to 5. If start is 0, a random selection of
knots is loaded. This command uses singlebuffer mode so that the knots can be seen while they are
being loaded. Clicking with the left mouse on an image in the zoo will load that knot or link.
Creating new knots and links
These commands will create something from scratch. In addition you could load a knot or link from
the catalogues with the
one yourself. See also the
command below, which can be used to construct user-defined things. The commands chain,
lissajous, 2lissajous, torus, and unknot are affected by the
Creates a linked chain with ncomp components (this number should be even) of
nbeads each. If nbeads is omitted, it defaults to 9. The parameters
control the geometry of the chain.
Constructs the knot with Conway number n. Currently, only rational knots as defined by
Conway [? ] can be constructed. Non-rational knots may be constructed with the
nx ny nz [phix phiy nbeads]
Constructs a Lissajous knot [? ] of type (nx, ny, nz) and phase (phix, phiy) with
nbeads number of beads. If nbeads is omitted, the number of beads defaults to
. phix and phiy both default to 0 if omitted, and that's not too interesting.
For best results they should have different values. The parameterization of the curve is
except that phiz is zero. Check out
to see some examples and
to see some good values to try.
nx ny nz nk [phix phiy phiz nbeads]
Similar to the
command except constructs a 2-mode Lissajous knot.
- random tangle
Creates a random tangle using the tangle calculator. This is one of several methods of creating
random knots and links that will be implemented in KnotPlot in the near future.
to execute the commands in tangle-string. Click
for some examples. An interactive version of the tangle calculator can be accessed using the
n m [beads]
K(n, m). If beads is omitted, the number of beads defaults to
. Other parameters controlling how the knot is constructed are
. If two few beads are used, the results can be bizarre. If n and m are not
relatively prime, then a torus link with gcd (n, m) components is created. You
can also omit n and/or m to have values chosen randomly. A
page of examples
is at the KnotPlot Site.
Creates an unknot with B beads of radius R. in the xy-plane. If B is
omitted, the number of beads defaults to
. If R is omitted, the radius defaults to
Knots or links can be transformed into new knots or links using the commands in this section.
Other commands that could belong in this section are the
commands as some of these may change the knot type.
Takes the current knot and cables it.
compA [to compB]
With one argument, closes component compA if it is open, otherwise closes all components
in the range compA to compB. Without any arguments, prints out information on
all components. See the
- close all
Closes all components.
Transforms the current knot (one component only) into its ``companion'' knot.
Cuts a component at location bead. If the component is closed, it becomes open.
Otherwise two open components result. Small components (less than four beads) are automatically
reaped. See the
Deletes component n of the current link. Components are numbered starting at 0. See the
- delete all
Deletes the current knot or link.
Takes the current knot and doubles it.
Joins together beads a and b. Both a and b must be the
endpoints of an open component. See the
Identifies bead a and bead b. This is how
- identify init
Initializes (unidentifies) all bead identifications. Use this whenever specifying new
Deletes all knot components except component. Components are numbered starting at 0. Only
makes sense for links. See the
If value begins with a '+' or a '-' sign then the number of beads is incremented or
decremented by value, otherwise the number of beads is changed to value. See
- nbeads mult
The number of beads is multiplied by fraction.
compA [to compB]
With one argument, opens component compA if it is closed, otherwise opens all components
in the range compA to compB. Without any arguments, prints out information on
all components. See the
- open all
Opens all components.
Reverses the beads in component comp. If comp is omitted all beads in each
component are reversed. Useful in combination with the
Shifts the bead numbering in component comp by distance, which may be positive or
negative. If comp is omitted, all components are affected. Use the
command to turn on bead labels.
Swaps components compa and compb.
Relaxing knots and links
If you're running in an interactive mode, you should almost never need to enter any of these
commands, since everything can be controlled using the main
Sets the charge to value.
[allow |none |fast]
If the argument is omitted, prints the current collision constraint. If set to allow
collision checking is disabled. Mode none is obsolete and should not be used. Defaults to
Performs niter iterations of the knot relaxation.
Sets the spring constant to value.
Sets the exponent in the dynamical simulation to value.
Sets the time increment to value.
These commands affect the display of the knot or link. It is possible that they will also affect
any output geometry in the cases where the type of surface (broken, smooth) or quality is changed.
Sets the transparency to value. Should be avoided because transparency isn't correct
unless things are drawn back to front. A form of pseudo-transparency can be obtained by using
blendfunction one one and zbuffer false.
[true | false]
Enables or disables removal of backfacing polygons (see the GL manual).
Sets the blendfunction (see the GL manual). The parameters must be one of zero one
dc mdc sa msa da mda min-sa-mda sc
msc. This command is an exception to most commands in that abbreviations are not allowed for
the parameters. The default is blendfunction sa msa. This command may not work on all
for some examples of usage.
. This is useful if a cheaper quality rendering is desired in exchange for a faster drawing time.
Sets the clear functions used each time something is drawn. The value supplied for what
should be one of the following:
This function is useful for several neat tricks, include
and getting beads to leave traces during relaxation. Enter the command without an argument to see
the buffers which are currently being cleared.
- fz | zf The frame buffer and z-buffer will be cleared (this is the default).
- z Only the z-buffer will be cleared.
- f Only the frame buffer will be cleared.
- n Neither the frame buffer nor the z-buffer will be cleared.
Forces display to be updated, even if nothing has changed.
- display true
Forces the display to be updated, even if the parameter
is set to off.
Draws the knot as a NURBS (Non-Uniform Rational B-Spline. The surfaces output are actually uniform
and non-rational, but that would make them BS surfaces.) surface. Pretty slow, but shows the same
surface that would result from outputting a NURBS description to a ray-tracing program. Not
Switches to doublebuffer mode. In this mode, all drawing takes place in an off-screen buffer.
Changes the way the knot is drawn. Currently only five settings are of interest:
- normal Sets the drawing to its normal setting.
- spectrum Draws the knot as a ``spectrum''.
- flat Draws the knot flat shaded.
- broken Draw the knot as a broken surface. Controlled by the
- sbroken Combines the broken and spectrum options above.
above except produces high quality rendering. Sets
. May be very slow on some machines.
Makes the current knot loaded into a graphical object. Can greatly speed up the rendering time on
some machines. Must be used in conjunction with mode o (see below). This command is not
needed if a knot is loaded when mode o is already in effect.
material hue saturation value
Sets the colour of the indicated material. material must be one of the following:
hue, saturation, and value must be in the range from 0 to 1.
- The knot material.
- The bead material.
- The arrow material.
- The 4D knot material.
material red green blue
but uses RGB space instead of HSV space.
Sets the drawing mode. mode may be one of the following:
These settings may be OR'd together, for example mode cfb will draw cylinders, beads, and
force vectors. Use mode sc in conjunction with draw spectrum for bizarre effects.
- Draws the knot as a smooth tube, interpolating between beads depending on the
- Draws cylinders between beads.
- Draws the beads.
- Draws the force vectors.
- Draws the anchors.
Draws identification clusters (for knotted graphs).
- Draws the knot as a
graphical object. This setting is mutually exclusive of the others.
xs ys zs
Modifies the current view matrix by a non-proportional scaling factor. Useful for special effects.
xs ys zs
Sets the view to an orthographic projection with clipping volume x in (-xs, xs), y in
(-ys, ys), and z in (-zs, zs).
[x | y | z] angle
Rotates the current view about the indicated axis by an amount of angle degrees. Note
this is not the same as the
- rotate fix
Uses the current rotation matrix to modify the embedding of the knot and then resets the view
matrix to the unit matrix.
- rotate unit
Resets the rotation matrix to the unit matrix. This is equivalent to the
button on the control panel.
Switches to singlebuffer mode. In this mode, all drawing takes place in the on-screen buffer.
This way the knot may be viewed as it is drawn. The command
uses singlebuffer mode.
A command that will automatically adjust
to eliminate the deficit angle seen when
is too small. A
is available in the demos directory that illustrates the use of this command.
Enables or disables z-buffering.
These commands affect the embedding of the knot or link in space. They have no effect on the
viewing transform but will affect any surface models exported or anything saved with the
[x | y | z] angle [comp]
Rotates component comp of the current link about the indicated axis by angle
degrees. This may appear to be identical to the
command, but there is a difference. This command modifies the coordinate values of the link, thus
affecting any geometric data that might be written out in a file. The rotate command simply
modifies the viewing transformation. If comp is omitted, all components in the link are
modified. If comp is the keyword last then only the last component is rotated.
Translates the knot or link so its bounding is centered at the origin.
- centre mass
Translates the knot or link so its centre of mass is at the origin.
Fits the knot to a radius of size.
Displaces each bead by a random distance.
niters alpha redraw centre
Mangles the knot (single component) niters times. Each time the knot is mangled two beads
are chosen at random and one of the two arcs connecting the beads is rotated about the line through
the beads by a random angle (This function was inspired by a talk given by K. C. Millett at the
1993 meeting of the American Mathematical Society in Vancouver.). The angle rotated is chosen
uniformly between -alpha and +alpha If redraw or centre are
omitted then all mangling is done and then the mangled knot is displayed. Otherwise if
redraw is non-zero the knot is redrawn every redraw manglings. The
centre parameter is used in a similar fashion. Look
for a demo script using this command.
Reflects component comp of the current link about axis axis which must be one of
x, y, or z. Reflections can be concatenated, for example refl xyz will
perform an inversion through the origin. If comp is omitted, all components are
reflected. If comp is the keyword last then only the last component is reflected.
xs ys zs [comp]
Scales component comp of the current link by the factors xs, ys, and
zs in the obvious directions. Not to be confused with the
parameter. If comp is omitted, all components are scaled. If comp is the
keyword last then only the last component is scaled.
Splits every cylinder in two. Doubles the number of beads.
- split cylinder
Splits the nth cylinder in two.
Splits any cylinder with a length greater than value.
angle [x | y | z | r]
``Swirls'' the knot by the angle degrees about the indictated axis. If the second
parameter is omitted, it defaults to y. Use r to have a axis chosen at random. The
best way to see how this command works is to try it. This is one of a (eventually) large number of
homeomorphisms on three-space that will be available.
x y z [comp]
Translates component comp of the current link by the vector (x, y, z). This is a
translation relative to the current location. If comp is omitted, all components are
translated. If comp is the keyword last then only the last component is
- translate to
x y z [comp]
Translates component comp of the current link so that its initial bead is located at the
postion (x, y, z). Unlike the above command, this is an absolute translation. If
comp is omitted, all components are translated so that bead 0 is at the indicated
These commands produce pictures of one form or another.
Makes a cheapo ascii picture of the knot or link. Most useful when running without the command
window or without graphics at all (for example over a modem on a VT100 terminal). Assumes that the
knot fits into a bounding box of (-10, 10). You can use the
command to ensure this. If ysize is omitted, it defaults to 11/25 of xsize. If
xsize is omitted, it defaults to 50. Look
for some examples.
Outputs what is currently seen in the view window as a
( Portable Pix Map.) file. The output is written to the file name.ppm. Normally the
frame buffer is squished by the factor squish in both directions. If squish is
omitted, it defaults to the current value of
. Use a squish of 1 to output the frame buffer at full resolution. PPM files (the raw
version) are a good, simple, and useful file format for colour images. There are many tools
installed on most platforms that can manipulate PPM images.
Sets several options for Postscript output via the
command. Currently, keyword can be one of the following:
Enter the command without any arguments to see the current settings.
- bbox Changes the kind of bounding box written to the Postscript file. Here,
setting can be one of
- fullpage Bounding box will be the full page.
- smallest Bounding box will just enclose the figure.
- square Bounding box will be square (this is the default).
- extension Sets the file name extension (defaults to .eps)
- font Sets the font used for Postscript output. Default is /Times-Roman.
- texture Sets the file used for Postscript textures (applies to
Outputs the current knot as a Encapsulated Postscript file (EPSF). This command may be used to
produce pictures of the of the type seen
For this command to work properly, the program should be set to mode s and
should be around 1.0. Also,
should not be too high or enormous output files will be produced. Different effects may be
achieved by changing the value of
. The command
should be used first to eliminate any deficit angle.
Outputs the contents of the current view window as a Silicon Graphics RGB image with filename
Outputs the contents of the current view window as a Imager RLE image with filename
Exporting surface models
KnotPlot can export surface descriptions to several other software platforms. Note that all
these commands assume that drawing mode 's' is currently in effect (see the
command). Bizarre effects will occur if this is not the case. Also they work only for one
component knots. This is a minor limitation because separate models can be can be exported for
each component of a multi-component link (just use the
commands in the right order).
If you're unsure which command to use, check
Outputs a NURBS description to the file filename.hs in the format suitable for input into
Outputs a DXF NURBS description to the file filename.dxf suitable for input into the ALIAS
Outputs the current knot as a collection of bézier patches in a format suitable for input
into the raytracing program Optik.
Outputs a DXF polygonal face description of the current knot to the file filename.dxf. If
option is present and equal to broken or if the current drawing function (see the
command) is broken the knot is output as a broken surface.
Outputs the current knot as a collection of polygons in a format suitable for input into the
raytracing program Optik.
Outputs a SDL polygonal face description and model of the current knot to the files
knotD.sdl and knotM.sdl.
Outputs the current knot as a BPF ( Basic Polygon Format.) file. BPF files may be passed through
a number of filters to input knots into other software packages, such as animation and raytracing
filename patchname shadername
Outputs a NURBS representation of the knot in a format suitable for input into the Alias renderer
or raytracer. The NURBS patch is given the name patchname and is assigned to the shader
shadername (defaults are Knot and KnotShader respectively). The output is
written to the file filename.sdl. The parameter
should be set to on before this command is used.
Outputs an Alias|Wavefront polygon description of the current knot to the file filename.obj.
Most of the commands in this section will be of interest to mathematicians. They may or may not be
interesting to other people.
Computes the Alexander polynomial for the knot (single component only). Needs Mathematica
somewhere on the system. Sometimes fails to give any answer, but if it does give one it is correct
- alexander split
Same as above except attempts up to ntries times to split problem cylinders. If
ntries is omitted, it defaults to 10.
Computes the Dowker code of the current knot (single component only).
Computes Simon's minimum distance energy [? ] of the current knot or link.
These commands all deal with four-dimensional knots.
If you're unsure which command to use for exporting a surface model, check
frames i1 i2 i3
Spin the knot in 4D.
Lb Le [on |off]
Enables or disables the drawing of a spun knot in the latitude range Lb to Le. The default is to
for an example of usage.
Outputs a DXF NURBS description of the currently spun knot to the file filename.dxf.
Outputs a polygonal DXF description of the currently spun knot to the file filename.dxf.
Outputs a Alias SDL description of the currently spun knot to the file filename.sdl.
theta phi chi
First spins the knot about the spin plane. Then performs three rotations in 4-space by the given
angles about the planes specified by the saxes command. Final result is a knotted 2-sphere in
[bead1 bead2 [angle]]
Without any arguments, prints out the current settings for the spin plane. Otherwise draws the
spin plane between beads bead1 and bead2 and sets the spin plane angle to
angle degrees. This command will turn on the drawing of the spin plane. You can also
turn the spin plane on and off with the
command or by using the radio button in the main
plane axis1 axis2
Sets a plane in which four dimensional rotations are performed. With no arguments prints the
current settings of the rotation planes. Check
for some examples.
Sets the method of projection from 4D to 3D for the higher dimensional surfaces. Currently
projection must be one of the following:
- uses an orthographic projection.
- uses a perspective
projection. The distance of the 4D-eye from the origin is set via the parameter
- this uses the Hopf mapping from 4D to 3D. Can be expected to produce weird
name [par1 [par2 [par2 ... [parN]]]]
Invokes the constructor KP-cons-name with the given paramters. Examples of constructors,
and others are in the demos directory.
This command is not documented and never will be.
Knots and (soon?) links can be exported as Metafont programs. This feature is under development,
but is available for test purposes and
can be found.
This HTML file was produced at 5:42 p.m. on February 7, 1997
directly from the LaTeX source.
main WWW site ], [