Fixture2D Applet Documentation

1. Features

Part Drawing Fixture2D allows the user to draw a part by clicking the mouse in the part drawing area. Click the Start New Part button to start drawing or to cancel a partially drawn part. Click such that a positive part is drawn in a counterclockwise direction. A negative part, such as a hole in a plate, can be drawn in the clockwise direction. Fixture2D will not allow you to draw crossed part lines. To close the polygon and complete the drawing, click the Close Polygon button. There is no limit to the number of edges in the part, but you may find that the fixture synthesis computation will take considerable time for parts with more than 40 edges.

Stayout Zone Drawing Add stayout zones if desired. A stayout zone is any convex region of the part space that the user wants to be excluded from consideration in fixture computation. For example, you would want to exclude any edge that is to be worked on while the part is held in the fixture. Click the Add Stayout button to add a stayout zone. Click the mouse to indicate the stayout zone vertices. Click the Close Stayout button to complete the stayout zone. The user may add up to 20 convex stayout zones. Concave polygonal stayout zones may be accommodated by drawing several convex stayout zones.

Fixture Synthesis When you have drawn the part, click the Compute Fixtures button to begin the fixture set computation. The progress of the computation will be shown in the status text window. The fixture synthesis runs in a separate thread so you may continue browsing during a particularly long computation. Just back up to the FixtureNet III page from time to time to check the result of the computation. When done, the first (best) fixture will be displayed in the fixture display area. If more than one fixture is found, step through them with the Next and Previous buttons. If no fixtures were found, you either drew the part too small (so it slips through the fixture grid) or you specified stayout zones such that no fixture is possible. The fixtures are sorted in order of a quality metric that favors an even distribution of reactions on the fixels.

1.1 Advanced Features

Applets are intended to present a simple user interface with a limited feature set. However, certain advanced features are useful for testing or advanced work. These features are not intended for the casual user and are accessed via a relatively arcane but workable method.

Stock Parts Stock parts for testing and benchmarking may be loaded by clicking the Start New Part button and then clicking the upper right corner of the frame around the part drawing window. Repeat to cycle through the available stock parts.

Drawing Snap The drawing snap can be set to 5, 10, or 25 pixels (equivalent to 0.1, 0.2, and 0.5 part space units, respectively). When in drawing mode (after clicking the Start New Part button), click on the lower right corner of the frame around the part drawing window. Additional clicks will cycle through the available snap settings back to the default zero (single pixel resolution).

1.2 Applet Parameters

The applet parameters are set in the calling html file like this:
    name = "ClampType"
    value = "1">
    name = "QualityMetric"
    value = "0">
    name = "ClampFilter"
    value = "1">
    name = "RespectVertices"
    value = "0">
  You need a Java-enabled browser to see the applet.
A ClampType of 0 is a simple circular locator. ClampType 1 is a bullet-shape. With QualityMetric set to zero, the generic quality metric is used (see the PhD Dissertation of Rick Wagner). When set to 1, the fixtures are sorted in order of configuration angle. With ClampFilter set to 1 the type 1 clamps are filtered for interference withe the locators and the part itself. When RespectVertices is set to 1, fixtures with any vertex closer than a fixel radius to any locator are filtered out.

2. Classes

The Fixture2D applet is comprised of 17 classes:

Class:                   Description:
DisplayArea.class        Extends Canvas
DrawingArea.class        Extends Canvas
Edge2D.class             2D edge object
EdgeSet2D.class          Encapsulates a vector of Edge2D objects
EdgeTriple2D.class       A triple of Edge2D objects
Fix2D.class              Fixture object
Fixture2D.class          Applet class for the GUI
FixFun2D.class           2D fixture functions
FixtureSet2D.class       Encapsulates a vector of Fix2D objects
FramedDrawingArea.class  Extends Canvas
FramedDisplayArea.class  Extends Canvas
Geom2D.class             2D geometry function library
IntSet2D.class           Set of integers
Part2D.class             2D part with stayout zones
PartConfig2D.class       2D part in contact with three locators and a transform
Point2D.class            2D point
VofV.class               Encapsulates a Vector of Vectors for 2D array operations

The relationships among these classes are shown in the diagram below:

The Fixture2D has a Part2D object which is the input part drawn by the user. It also has a FixFun2D object named FF which is used to pass the input part to for "growing." The grown part is returned by FF. Hence, Fixture2D "has two" Part2D objects. The grown part is then passed to FF and a FixtureSet2D named FS is returned.

2.1 Using FixFun2D

FixFun2D.class is a library of fixture functions, two of which are publicly available and may be called from any Java application. The first of these,
public Part2D GrowPart(Part2D P)
is passed a part as a Part2D object and returns a grown part as a Part2D object. The grown part has its edges moved outward by a fixel radius (passed to the FixFun2D object when it is created), and trimmed by themselves (in concavities) and by any grown stayout zones.

The second public function, the fixture synthesis engine

public FixtureSet2D ComputeFixtures(Part2D P, TextArea StatusText)
is passed a grown part and a TextArea object for status reporting and returns a set of fixtures as a FixtureSet2D object.

These functions may be called from a java application as shown in the examples below:

  public Part2D ThePart = new Part2D();
  public Part2D GrownPart = null;

  float FixelRadius = (float) 0.25;                      // Half inch diameter locators
  public float PixelsPerUnit = 50;
  public FixFun2D FF = new FixFun2D(FixelRadius);

  public FixtureSet2D FS = new FixtureSet2D();
The input part (ThePart), the grown part (GrownPart), the fixel radius (FixelRadius), the FixFun2D object (FF), and the returned fixture set (FS) are declared as instance variables in the Java application. They are declared public because they need to be referred to from the display and drawing area Canvas-derived objects.
    if ( == ComputeButton)
      PartPic.DA.NewPoint = null;

      // Begin fixture set computation
      GrownPart = FF.GrowPart(ThePart);

      // Display the grown part and stayouts
      iProgress = 1;

      SynthesizerThread = new Thread(this);
The GrowPart() function is called within the action() function (using the old Java event model because the Java 1.1 event model is not supported by many browsers today). A new thread is created to run the fixture synthesis because it is generally time consuming and users don't like being trapped. Starting a new thread lets users continue to use their browser while the fixture computation runs.
  public void run()
    FS = FF.ComputeFixtures(GrownPart, StatusText);
    if (FS.n > 0) giCurFixture = 1;

    // Display the first fixture of the returned set
    iProgress = 2;

    if (FS.n > 1) NextButton.enable();
The thread statements are executed in the run() function. The ComputeFixtures() function is called as a public method of the FixFun2D object, FF. FS is the returned FixtureSet2D object. The FixturePic.DA (display area of the framed display area) paint() event is triggered by the repaint() function. The paint() event code draws the current (default = 1) fixture from the fixture set.

All geometric functions use single precision floating point arithmetic. The zeroeth element of all arrays and vectors is reserved for object swap space (the first element of any array or Vector has the index 1).

3. Known Limitations

  1. If a part is drawn with edges in clockwise order, the part is treated as a negative (like a hole in a plate) and a fixture set is generated with no error (or other) message to the user.

  2. In growing a part by the fixel radius, only adjacent (in the EdgeSet2D) pairs of edges of the grown stayout zone are evaluated for self-trimming (in concavities). Thus, some edges in concavities shorter than a fixel radius may be deleted and remaining edges will not be properly trimmed. This could be corrected by also comparing pairs of every other edge (and every third, and so on). Correcting this limitation is not planned.

  3. For the "respect vertices" parameter option, fixels in concavities will exhibit twice the standard distance (a fixel radius) of standoff due to edge trimming in concavities.

4. Version History

Version  Date           Description
1.00     May 1, 1997    Prototype for GUI feedback. Synthesis engine non-functional.

1.24     June 10, 1997  Alpha test version, fully functional. The Compute Fixtures,
                        Next Fixture, and Previous Fixture buttons were moved closer
                        to the fixture display area. Thanks to Charles Anderson for that

1.30     June 16, 1997  Beta test version. Fixes the vertical line self-trim bug and the
                        non-diamond grid third locator leak bug. Adds three stock parts
                        for loading and drawing snap options as advanced features.

1.33     June 18, 1997  Adds F2DStatClient object for communicating with a Java server
                        (F2DStatServer.class) to collect statistics on the user parts
                        submitted and fixture sets returned. If no connection is made
                        to the server, the F2DStatClient is destroyed. If a connection
                        is made, the client object gets a session ID from the server
                        and then stops listening. Part data are then sent for each
                        new part submitted for computation, and fixture set data are
                        sent for each fixture set computed. Statistic data are written
                        to a file by the server.

1.35     June 27, 1997  Fixes a minor bug in the edge triples identification. Improves the
                        data sent to the statistics server. As a courtesy to the user, all
                        data transmitted from his client to the server is echoed in the
                        Java Console. Compiliation with the optimization switch results
                        in 6198 bytes reduction in the size of class files but gives a
                        6% increase in run time for the SC-shaped part.

1.36     July 12, 1997  Adds error trapping for the NullPointer error in F2DStatClient
                        connection in init() that would occur for the OS2 Netscape 3.0
                        client behind the IBM firewall in Zurich. Adds an option <param
                        "ClampType"> to draw a bullet clamp representation.

1.39     Sep. 1, 1997   Shortens the clamp symbol to reduce apparent part interferences.
                        Adds the "4-unit Right Triangle" stock part. Adds a parameter
                        option to have the fixture set sorted on "closeness to orientation"
                        which is set in the html code.

2.00     Jan. 12, 2001  After four years of operation, some new enhancements are in work.

2.01     Jan. 13, 2001  Implements a variable clamp length (coded as an instance variable
                        definition. The implementation is for a symbolic clamp (bullet shape)
                        only. We don't know what a real clamp actually looks like. Attempting
                        to code for every conceivable clamp shape is impossible. Approximately
                        3 hours programming time.

2.04     Jan. 15, 2001  Implemented filtering for clamp interference, in two parts. The first
                        filters for interference with  the part, the second filters for
                        interference with the locators. Fixes the duplicate locator triple
                        bug. Approximately 9 hours programming time.

2.05     Jan. 16, 2001  Implements double buffering for the fixture display area (FDA).
                        Changes the way the "respect vertices" parameter option works
                        (offending configurations are filtered out completely instead of
                        having their quality metrics divided by a thousand). Approximately
                        4 hours programming time.

2.07     Jan. 17, 2001  Implements reaction force display for computed fixtures. Approximately
                        8 hours programming time.

5. Attribution

The fixture synthesis algorithm of FixFun2D.class is based on the algorithm of Randy Brost and Ken Goldberg as described in A Complete Algorithm for Synthesizing Modular Fixtures for Polygonal Parts, ICRA 1994. Other algorithms, such as the quality metric assignment, were originated by me, as was all source code. Some GUI classes were derived from sample code published at

Charles Anderson at Berkeley did the first successful Java user interface as a front end to my fixture server (see FixtureNet II). The fixture server was also the engine behind the original FixtureNet. Experience using Charles' excellent implementation, and Charles' helpful comments, influenced my design.

You may use these classes for academic research or educational purposes. If you use these classes, or any classes derived from the source code, you must attach appropriate attribution to source files and the program user interface. A link to my home page will also be appreciated.

Comments? Please send E-mail to Rick Wagner (

Visit my USC home page.

This page established June 10, 1997; last updated January 18, 2001.