Cuspy Contour Editor Utility
Quick Contents
Overview
Cuspy is a utility for editing spline contours in 2D space. A B-Spline is used to determine the curve. The curve may be either an open or closed one.
Cuspy Execution
The Cuspy program is invoked as:
> cupsy (filename)
Menu, Display and Manipulation
A window is displayed as in Figure 1, showing
the contour, its control points. If the filename arguemnt specifies a
a valid contour file, the file will be loaded. Otherwise, a default contour of
four control points forming a closed circle about the origin.
Figure 1 - A cuspy screen
Manipulating the contour
- Moving control points - The shape of the contour is manipulated by moving
control points about by dragging them with the left mouse button.
- Adding control points - Control points can be added by clicking the middle
mouse button at the desired placement location. Clicking the left and right buttons
together can also be used.
- Deleting control points - A control point can be deleted by clicking on it
with the middle mouse button. Clicking the left and right buttons together can also
be used. Neither the first nor last control point of the contour can be deleted.
Also, the contour si constrained to have a minimum of four control points at any given
time.
- Altering Multiplicity - The multiplicity of a control point can be increased
by double clicking on it. A point may have a maximum multiplicity of three, so double
clicking a point with multiplicity of three will reset it to multiplicity of one. The
colour of a control point will change to reflect the multiplicity change.
Manipulating the View
- Zooming - Zooming the view is done by dragging the view with the left mouse
button while holding either the Alt or Ctrl button.
- Panning - Panning the view is done by dragging the view with the left mouse
button while holding the Shift button.
The Popup Menu
The cuspy popup menu is controlled using the right mouse button.
The menu contains the following items:
- Reload - This will reload the contour from file. Any changes since the
last save will be lost when this is done.
- Save - Save the contour to file specified when the program was invioked.
If there was no filename specified, the user will be prompt for one.
- Save As - Prompts the user for a filename and saves the funtion to that
file.
- Closed - Flags whether the contour should be open or closed.
- View Points - Toggles whether the control points are visible. This is
on by default.
- View Segments - Toggles whether the line segments connecting control points
are visible. This is off by default.
- View Curve - Toggles whether the contour curve visible. This is
on by default.
- View Axes - Toggles whether the spatial axes are visible.
This is on by default.
- Reload Colours - Reloads the colours from the configuration file.
- Exit - Exits the utility. If there was any changes since the last save, the
user will be prompted to save
- Help And About - Opens that Help And About Dialog. A short in program reference
can be found here.
Configuration
The colours used in cupsy can be configured be editing the configuration file in VLAB. The configuration file is shared with that of the function editor, Funcedit. In the VLAB conguration directory ($VLABCONFIGDIR), there is a file called 'funcedit' that may contain a line entry for each configurable colour. Each entry needs three values for red, green and blue colour components, scaled from 0.0 to 1.0.
List of Configurable Fields
- background
- points
- segments
- curve
- grid
- xaxis
- yaxis
- labels
An example entry would then be background: 0.0 0.0 0.0 which would give a black
background.
Contour File Format
The contour file format consists of the contour's number of control points, number of dimensions,
whether it is closed or open and the xy-coordinates of each point. By convention, the extension of
the files is .func, but this is not strictly required. The number of dimensions specified
always be two, but higher numbers are possible for reading the file to support backwards compatibility.
Example contour file:
5 2 closed
0.40 0.40
0.54 0.02
0.40 -0.40
-0.40 -0.40
-0.40 0.40
Credits
Colin Smith - Cuspy Implementation and Documentation, vL1.0
Last updated December, 2001 by Joanne Penner