JavaGami Beta Version 1.0

1/26/99

Truncation

12/10/98
Version: 8.5 Alpha

Truncation at a single vertex is implemented in this version. The user clicks on the vertex and specifies a truncation length which represents a percentage of the edge length. The algorithm selects three edges containing that vertex and calculates points on those edges (for example, a truncation length of 0.5 means that the algorithm will find three edge midpoints). The algorithm then calls the "Split Solid" routine to slice the shape into two parts.


Rotation

12/2/98
Version: 8.4 Alpha

The algorithm to rotate a solid object has been implemented in this version. A rotation matrix is applied to the polyhedron object, new screen coordinates are calculated, and the solid object is redisplayed. The interface is crude in this version -- the user must first click the "rotate" button, then enter the rotation quantity/direction, and then click the "unfold" button to see the rotated solid. The desired interface is one in which the user simply clicks one of x, y, or z-rotation buttons and the solid update is done automatically without clicking the "unfold" button.


Tool/Color Indicator

11/4/98
Version: 8.3 Alpha

User testing with children this semester shows that one source of interface confusion is that the highlights which mark the active tool and color often lag behind the child's mousing actions. The tool/color indicator eliminates the need to highlight the active tool, and gives the child more decisive feedback about the tool/color in use.


Polyhedron Slicing

10/21/98
Version: 8.2 Alpha

Note on version numbers: versions 2.0 - 7.0 Alpha are primarily debugging/experimental versions and are not summarized here.

A single polyhedron can now be split into two parts. The algorithm can in principle take any three arbitrary points -- this version of the interface prompts the user to specify 3 vertices by clicking on them in the "Polyhedron" window.

The algorithm calculates the plane specified by the three points, and then sorts the vertices and the faces of the polyhedron according their location relative to the plane. It creates new vertices by calculating points of intersection between the polyhedron edges and the slicing plane, and then assembles two separate polyhedra. It closes each polyhedron by creating an additional new face consisting of edge-intersection points and vertices which coincide with the splitting plane, taking care to order and orient the new face in a manner consistent with the rest of the polyhedron.


Java Applet Ported to Java Application

Wireframe Updating

9/24/98
Version: 1.0 Alpha

A major design decision made at this stage is to build JavaGami as an application rather than an applet. Applets run through web browsers and use Java's security model -- making it very difficult for applets to create new files when running. Since Java applications run locally, the applications can easily create new files on the user's system.

This feature of applications versus applets is important for JavaGami because users may want to create and store their own collections of custom polyhedra/folding net "libraries." The primary code changes are to create a main application window, and to eliminate calls using URL methods and instead call local file input/output methods.

Porting JavaGami from applet to application also simplifies the update of the wireframe object when operations such as capping, truncation, etc. are performed on the solid. The Model3d class creates the wireframe object by taking an input stream from a file as a parameter. The logical way to perform the update is to write the new solid information to a file, call Model3d, and have the 3d viewer (the window that shows the 3d model) refresh itself, showing the new wireframe object.

The primary interface difference in the JavaGami application is that it runs independently of a web browser using a main application window as well as other windows for storing tools, shapes, and so on. Wireframe updating as implemented in the JavaGami application is shown below.


Capping

8/9/98
Version: Applet 0.831d

A general capping algorithm has been implemented which allows the user to click on any of the visible faces of a polyhedron shown in the "Solid" window (rotation has not yet been implemented) and to add a pyramidal cap of user-specified height to the clicked face. The system calculates the new polyhedron and folding net.


Linear Maps

8/8/98
Version: Applet 0.82

Version 0.82 includes an implementation of linear map functions to stretch polyhedra along x, y, or z-axes by arbitrary amounts and to calculate the corresponding folding net.


Integration of Unfolding Algorithm with Interface

8/4/98
Version: Applet 0.8

The code for the unfolding algorithm has been integrated with the existing applet interface. The next step is to build some solid modeling tools!


UNFOLDING!

7/26/98
Version: Applet 0.77

The real-time unfolding algorithm has been successfully implemented in this version. Given a 3-dimensional polyhedron object, the algorithm produces a 2-dimensional folding net object. This is the core of the JavaGami environment and will enable users to create custom polyhedra and folding nets beyond the pre-programmed objects.



Plans for summer 1998:


What's been implemented to date (June 1998):

JavaGami Version 0.75

6/8/98

This is the current state of JavaGami to date. The significant change from the previous version (0.7) of JavaGami is that entire interface appears in a single applet window. Testing on smaller screens (like the ones common in schools) showed that the previous screen layout of JavaGami took up too much space. There is a shape picker bar running across the top of the applet, a 300x300 pixel net window; a 150x150 pixel wire frame browser window, and smaller tool and color palettes. The next version of the interface will have a toggle function for the palette windows to show more options.


Computational Geometry Package

5/9/98 - 5/31/98

This is a package of computational geometry utilities which will be used in the net-generation (polyhedron unfolding) algorithm.

Basic classes:

List of methods implemented

JavaGami Version 0.7: Wire Frame Renderer Integration

4/12/98

A three-dimensional wire frame polyhedron renderer (based on Sun's public domain code) has been integrated into JavaGami.

3D classes added: Matrix3D.java; Model3D.java; ThreeDViewer.java (performs the paint and updates of the wire frame model on a canvas object)

Each wire frame object is stored in a (.obj) file. The data in the file consists of the vertices of the object, followed by a list of vertex numbers of the faces. For example, for the octahedron:

v 0 0 1
v 0 -1 0
v 1 0 0
v 0 1 0
v -1 0 0
v 0 0 -1
f 1 2 3
f 1 5 2
f 1 3 4
f 1 4 5
f 6 2 3
f 6 5 2
f 6 3 4
f 6 4 5

Each PickerPoly layered upon the PickerCanvas has an associated myWireFrameFile. When PickerCanvas receives a mouseDown, it finds the clicked PickerPoly and then loads both the folding net and the wire frame object.


JavaGami Version 0.65: Tool Palette and Color Palette Integration

4/7/98

The tool and color palettes are now integrated. All colors in the color palette are working; draw, fill, line, rect, and circle are working in the tool palette.

GridBagLayout does not display Panel objects in the right way -- when the tool picker was initially a child of Panel, it drew only as a tiny square. The tool picker was reimplemented as a child of Canvas to eliminate the problem.


JavaGami Version 0.5: Shape Picker Integration

3/29/98

This applet takes a mouse click on a GIF image (a shape picker) opens the iostream of the corresponding folding net file, loads the folding net into usage as the currentNet, and then draws the polygons of the currentNet. The picker and net window appear in the same (applet) browser.

Bugs fixed in this version:

1. Scoping in ImageCanvas.java:

(line 73) this works:

tempnet = new FoldingNet(is);

where tempnet is declared as a variable at the beginning of the class but this:

FoldingNet tempnet = new FoldingNet(is);

is too narrow in scope -- after the "try" clauses, tempnet is null.

This bug took a while to fix because it *looked* liked the net was getting read into the input stream, but after it was read, it was null.

2. "Webbing" drawn in output of folding net: The folding nets displayed, but with extra lines from the *last vertex of each polygon* to the origin (0 0). The culprit was in FoldingNet.java. The constructor for FillPoly while reading the input stream was called indexing one place too far into the read array, thus adding the point (0,0) -- which happened to be in the array -- at the end of the coordinates of each FillPoly.


Test Input Project-v0.2: Constructing Folding Net Objects from IO Streams

2-5-98

This applet constructs a FoldingNet object from an input stream. The data for the folding net is in the file "test.net".

The constructor new FoldingNet(is) is called on the stream. The input stream is parsed, and the points are added as FillPolys in the myFillPolys slot (a Vector) of the FoldingNet class.