Thursday, March 3, 2011

Bugs and Books

Heyho,

This week I was finally able to meet up with Steve Gray and Vijay Kumar. Steve was able to help me out a lot. I was able to identify a bunch of bugs with my rotation springs that were causing problems outside of the basic diagonal fold. The major one is that for some reason acos(double) is returning values only from 0 to pi and not -pi to pi like I would like it to. The problem clearly manifests itself when I turn off gravity and collision with the ground and the paper continuously rotates itself around over and over again. Originally I thought I could determine the angle with a cross product between the two arms that define the angle. However, this does not seem to produce consistent results. Since I have two arms to define the angle, I can use a cross product between one arm and the rotation axis to find a plane. Then if the point is above the plane(in the direction of the normal), I know the angle is positive. There are a few other bugs and Steve was able to explain a bit about how to add damping to the rotation spring.

In addition to that bug chasing I was able to clean up some more code, making it easier for me to create different lattices by putting them into separate methods. So I was able to implement a vertical fold (also known as a book fold).



Here I actually use two of my rotation springs on top of one another. One rotation spring moves the top corner while the other moves the bottom. The paper is a little floppy here, but I am pretty happy with the result.

I have a few things I want to get done over spring break. The first one is clearly fix the bugs that have arisen in the rotation springs. After I fix the bugs in the rotation springs I want to try implementing them differently where I can apply torque to multiple particles in the lattice, not just one. This way I can try applying force to the particles that are adjacent to the rotation axis, not the furthest particle away. Steve thinks that this implementation will work better than the current one and I agree. I also want to work on an XML schema that will quickly let me test different crease patterns. The XML schema will contain the length and the width of the grid and the location and properties of all the rotation springs. Then I will generate the particles and the rotation springs. After that I will add the bend, structural and shear springs, however I will do a 2d line-line intersection test with all the rotation springs in the system. This way I can make sure I am not adding linear springs on top of rotational springs that could prevent flat folding. Once I get that done and working I can test more and more complex folding systems.

No comments:

Post a Comment