__Week 1
(May 17, 2000 - May 19, 2000)__

**
Introduction to program worked on by J. O'Rourke and Biliana Kaneva. The program is an implementation of an algorithm proposed by Chen & Han for computing Shortest Paths from a source vertex to all other vertices on convex polyhedra. **

**The final output comes as a result of two programs. First, chull.c computes the necessary output for use in GeomView (geometry software). This output contains the data associated with the polyhedra that will enable GeomView to display the object. The output is as follows in exact order:**

- Number of vertices, number of faces, and number of edges. All in one line.
- Number-of-vertices rows, each row containing the x, y, z coordinates of vertex.
- Number-of-faces rows, each row containing the global indices of the vertices of the face. In addition, each row's first data is the number of vertices on the face.

Second, chull.c runs again. This time the output consists of a ".in" file, which contains the necessary data to run sp.c (the shortest path program). The output is as follows in exact order:

- nF = number of triangular faces.
- nV = number of vertices.
- 2D coordinates and indices of vertices for each face.
- Gluing instructions for each face.
- Source vertex specified by: index of source face, and local index of vertex on face, {0, 1, 2}

**
Once these files are created, sp.c runs and computes the shortest paths on the polyhedra with the data given. chull.c runs again and outputs a file with the data received from sp.c, that can be used with GeomView, in order to view the shortest paths. At the end, GeomView is launched and both the polyhedra and its shortest paths are displayed.**

The following were changes I made to polyhedra.c:

- I changed the output of polyhedra.c, so that it can be used by GeomView. This was fairly simple, since the outputs are similar except for how they are displayed.
- I stored the above information in an array, since polyhedra.c simply displayed the results in standard output format.
- polyhedra.c also output the number of faces and provided a global index for each vertex. Again, this data was sent to standard output and not stored. I created another array to store this data.
- Using this information, with Joe's help, I wrote a function that would compute the adjacencies between each triangular face in the polyhedron.
- Once these adjancencies were computed, I could now use this information to compute the gluing data of the faces. I wrote a function that computes this information.
- The final task of the week was to write a function which would compute the xy coordinates of each vertex. This is the data necessary for use in sp.c

__Week 2
(May 22, 2000 - May 26, 2000)__

**
First thing I worked on was getting the ".in" output file with data in the order that sp.cpp needs. As soon as that was done, I ran test polyhedra data through sp.cpp. Some of my tests worked but others failed. The data in the ".in" file crashed sp.cpp. The error messeges produced by sp.cpp were inconclusive, hence Joe and I set out to debug the program.
**

**
We settled on the fact that the 2D coordinates of the vertices were accurate, thus the problem must lie in the gluing instructions. In fact, after careful investigation, we discovered that the gluing instructions were inaccurate. In addition, the data we were giving sp.cpp included vertices that were not "used", i.e. vertices that were part of the "box-input diagram" but not part of the actual polyhedra ( the dashes ). We needed to create code that would eliminate from the data those vertices that were not being used. Once these errors were corrected, sp.cpp no longer crashed.
**

**
We were now up to the task of using the ".out" file data in conjunction with original data provided by polyhedra.c, to produce a ".vect" file which could be used by GeomView to diplay the shortest paths on the polyhedra. Although complex in the code, the data was available. It was just a matter of organizing it so that the .vect file could be created.
**

**
Another smaller task of the week was to set up "command-line" parameters for polyhedra.c. Also, the program received the more precise name of ortho.c.
**

**
Click here to view images created by ortho.c.**

__Week 3
(May 29, 2000 - June 2, 2000)__

**
This week's task was to create a program that would compute the xy coordinates of the upper and lower circles on a cone. The program would then use these coordinates as input to convex.sh. The purpose is to see the shortest paths on the surface of a cone or cylinder.
**

**
**

- radius 1
- radius 2 (this would be zero, if cone)
- height
- number of points to be computed (the greater the number of points, the smoother the circle)

Click here to see images created with

__Week 4
(June 5, 2000 - June 9, 2000)__

**
**

The task for this week is to work on sp.cpp, in order to extract information about the shortest paths and use it to create "unfoldings" of polyhedra. We need to determine the xy coordinates of every vertex at the end of a path and the length of said path.

Since Joe does not return till Tuesday, I took the day to get a better understanding of sp.cpp. Due to the complexity of sp.cpp, the task is quite challenging.

I was able to successfully make a call to the *displaytree()* function of the class CTree.h and passed it the *root* Cone pointer. Not being too sure, I worked under the assumption that *root* is the first node of the complete tree.

__TUESDAY__

Initially, Joe and I worked unsuccessfully on sp.cpp. We attempted to pass the *root* Cone pointer to the "displaytree( )" method of the ctree.h class. Our assumption was that *root* was the first cone of the tree and that "displaytree( )" would then give us the desired output (xy coordinates of all vertices at the end of each path, in order). For unknown reasons, this was not the case.

The next project at hand was to create 2D images of some of my GeomView images using Mathematica® to view them as an Adobe Illustrator file. These images were for Joe & Biliana's paper. For the images created by convex.sh, this was straight foward, since chull.c allows for Mathematica® outputs. I just needed to get the mma (Mathematica® output file) and run it on Mathematica®, then get a nice angle of the picture and save it.

For the images created by ortho.sh, I am currently completing a new function for ortho.c that will create a Mathematica® output.

__WEDNESDAY__

Ortho.c received a new function, *MathOut( )*, which creates a Mathematica® output file. Having completed ortho.c, I created a couple of output files for use in Mathematica®. When Joe viewed them, he discovered that, an existing Mathematica® bug was causing some of the shortest paths to "disappear". They were not actually disappearing, but were being drawn just barely underneath the surface of the polyhedra, thereby not visible from the exterior. This was occuring in both, the images produced by ortho.c and chull.c.

After some inspection, Joe's solution was to use a Mathematica® function called *AffineShape*, which reduces the size of the polyhedra by some factor (in this case, 0.999). This function could be used directly by the chull.c output, since chull.c draws convex polyhedra around a center point (*AffineShape* reduces an image by bringing it closer to the center point by some factor). The *AffineShape* function was simply called with the "face" info.

For ortho.c, this was not straightfoward. Ortho.c does not have a center point. It was necessary to:

- select one,
- translate the image using the
*TranslateShape*function,towards the point, - shrink it there,
- then translate it back to its original position.

Also, I created a new orthogonal image, __boxring__, that is a sort of cube skeleton. Joe requested this image, and with ortho.c working so well, it was very simple to create.

__THURSDAY__

The orthogonal images created yesterday had a flaw. For these particular type of orthogonal images (the spiral and the boxring), shrinkage was not necessary. Joe manually altered these. In addition, I re-coded chull.c to eliminate the extra comma mentioned yesterday.

After the images were done, Joe instructed me on a new task. His work on folding and unfolding requires a proof, for which he would like to see some evidence. He has two conjectures to prove and feels that proof of the second conjecture, might help him with the first.

The motivation is as follows:

*If a convex polygon is unfolded into a chain C,
with restrictions on the range of angle-turning, then
then the new chain, C*

*
In addition, the length of the fixed segment, L _{0},
will always be ≤ the length of C^{1}.*

My contribution is to be the following:

- Create a program that will generate random points creating a convex polygon.
- Compute the lengths of all segments.
- Compute all the interior angles of the polygon in order to compute the angle (to the horizontal) exterior to each interior angle. This angle will indicate the restriction of the turn.
- Check conjecture 1.
- Check conjecture 2.
- Display these checks graphically.

While I struggled to determine how best to approach this task, it occured to me that, since I would best display these pictures in Mathematica®, why not use Mathematica® to compute all the other data needed?

I am now in the process of reading up on Mathematica® (with which, for unknown reasons, Im having so much fun) in order to complete the task. Joe has written a Mathematica® function to compute the angles and before leaving, I wrote a small function to compute the length between two points. I will now identify how to program this, so that it will find the lengths of all the segments on the polygon.

__FRIDAY__

Unfortunately, most of my morning was spent getting the code to store the lines (two points/line) on a list. I realized later that in order to compute the lengths of the lines, I would need the points, not the line. Nevertheless, I now have a working function to check the length (distance) between two points.

I integrated Joe's *TriAngle* function. Now the program computes lengths and angles.

**
Next week, I will begin by modifying Joe's TriAngle function to eliminate the Print statements and, attempt to store these angles in a list. Once stored, I can subtract them all from 180° to get the "turn" angles.
**

__Week 5
(June 12, 2000 - June 16, 2000)__

**
After storing the polygon angles in a list, I computed the "turn" angle by subtracting each angle from Pi. After which I computed new turn angles for all the polygon angles by using the Random[] function.
**

**
With the help of various other functions, I was able to compute all new point values for the "unfolded" polygon.
**

**
Further tests are necessary now to determine if my numbers are correct.
**

**
UPDATE SUNDAY THE 18th
**

**
For the rest of the week, I struggled trying to figure out why I was getting angles that did not appear to be correct. I finally gave up and decided to wait for Joe to return.
**

**
Once Joe returned, he quickly realized that the formula he gave me to compute the angles was inaccurate. He was working under the assumption that L _{1} ( the first line ) would be on the x-axis and that P_{1} ( the first point ) would be at the origin. This of course was what was causing my faulty angles, since is not necessarily on the x-axis. Having corrected the problem, the focus now is to create the program within a Do loop, in order to let it run many examples. However, as I was cutting and pasting to a new Mathematica® notebook, the Mac crashed. Since the work that Joe did earlier was not saved, I had to attempt to replicate his ArcTan function for computing the proper first angle. I will need to ask Joe on Monday because what I wrote is again, not printing the right picture.
**

__Week 6
(June 19, 2000 - June 24, 2000)__

**
This week I focused on learning Java. My project, in addition to learning Java, was to implement the Mathematica project into a Java applet. Much of the material I read in the beginning of the week, was written in pre-ver1.2 Java, which means that it did not incorporate the Model-View-Controller.
**

** In order to learn the latest Java, I focused on MVC and have written my classes according to the "Listener" implementation.
**

**The program is not yet finished. You can see the unfinished applet here**

__Week 7 (June 26, 2000 - June 30, 2000)__

**
This week, as I became more comfortable with Java, the program grew into 5 files. It now looks something like this:
**

*PolygonUnfolding.java*- This file extends applet. The buttons are placed here and the user can place points on the browser. These points are followed by "connecting" segments once the second point is placed. Once the polygon is finished, the user is able to select a point on the polygon. The selected point and every point and segment after the selected point (up to n-1), will turn red, indicating that that chain may be moved by draggin on the browser. In addition, the "forbidden circle" is displayed.
*DoMath.java*- Mathematical formulas to compute angles and points are in this class.
*MouseController.java*- This class implements MouseListener and MouseMotionListener to respond to user mouse activity.
*ButtonController.java*- Class implements ActionListener and responds to all button activity by calling the pertinent methods from the Point class.
*Point.java*- This class takes care of most of the polygon manipulations. The data arrays are here along with all functions that work on them, including handling of the input from mouseDrag event.

__Week 8 (July 3, 2000 - July 7, 2000)__

**
**

**
Added utilities to the applet have expanded my program to 11 files. The 6 new files area:
**

*PolygonApplet.java*- This is now the file that extends applet. The need to establish modality to the applet in the case of an input error, forced me to create 'Frame' class which now holds a Canvas (for drawing the chain) and Panel (for buttons). With this implementation, the error box (Dialog) can now be set to true, in order to prevent further input to the Canvas.
*checkWindow.java*- This file extends WindowAdapter and implements the windowClosed method to allow user to close the frame.
*ErrorFrame.java*- A misnomer. Actually this is the class that extends Dialog which is responsible for the error boxes.
*CanvasArea.java*- The only method present here in the paint().
*FrameHelp.java*- Displays a frame with TextArea. Information on the use of the applet is displayed when user presses help button.
*ForbiddenCircles.java*- The class I am currently working on. Computes data necessary for display of all concentric forbidden circles for each chain 'joint'.

** **

**
**

__Week 9 (July 10, 2000 - July 14, 2000)__

**
**

** **

** **

** **

** **

**
****
**