This applet/application demonstrates the mid-point smoothing algorithm. It was implemented so that it can run as both an applet as well as a standalone application. The implementation is divided into 4 parts: Menu Bar, Drawing Area, Status & Information Bar, and Simulation Control Bar.
File | |
New | Erase all points and thereby clear the canvas. |
Disabled at the moment. | |
Exit | Close the program window and exit. |
|
|
x-Direction |
Scale drawn polygons in the x-direction only to fit the canvas. |
y-Direction |
Scale drawn polygons in the y-direction only to fit the canvas. |
Both |
Scale drawn polygons in both the x and y directions to fit the canvas. |
|
|
B/W | The color of descendants is black |
Colors |
Each descendant has one of the following colors. If CYCLE THRU is selected, the program cycles through these colors with every iteration of the smoothing algorithm. The available colors are: Gray, Red, Orange, Yellow, Green, Magenta, Cyan, Blue. |
|
|
Golden Mean |
The descendants switch from a simple to a non-simple polygon. In theory, the descendant never becomes convex. |
Star |
In theory, all descendants remain stars of the same shape. |
Noisy 'E' |
An example of a noisy character that can be effectively smoothed with very few iterations of the mid-point algorithm. |
Attneave |
This is Attneave's example (cat). The two point algorithm neatly recovers the curvature on the body of the cat, thus allowing easier perception of the input polygon. |
|
|
User's Guide | Contents Window and About Window |
|
|
Left Mouse Button | Used to input the vertices of new polygons. |
Right Mouse Button |
When a new polygon is being input, signals that the whole polygon was input. Otherwise, resets the program to restart any iterations on the original polygon. |
|
|
Run |
The mid-point (or two point) smoothing algorithm is applied as many times as specified on the 'iterations' scrollbar. The speed of the simulation is governed by the value on the 'speed' scrollbar. |
New | Erase all points and thereby clear the canvas. |
Stop | Interrupts the execution of the algorithm. |
Step | The algorithm is applied only once. |
|
|
Speed |
This scrollbar governs the speed of the application of multiple iterations of the smoothing algorithm when 'Run' is pressed. |
Iterations |
This parameter determines the number of times that the algorithm will be applied. |
|
|
Mid-Point Algorithm |
Given a polygon, the smoothed polygon is obtained by joining the midpoints of its edges in the order encountered. |
Dual-Point Algorithm |
Given a polygon, the smoothed polygon is obtained by joining two points from each edge to corresponding points from other edges in the order encountered. |
This bar gives various pieces of relevant information. For example, when inputing a polygon, mouse coordinates are displayed for accuracy. And, when a whole polygon is input, its size is displayed. This bar also displays information about the current iteration number, and it also gives various warning messages when certain events occur. These warning messages appear in red.
Try it out!