Thursday, April 28, 2011

Posters and Presentation

So today was the CG@Penn poster session and senior project presentation day. They both went amazingly great. I would upload my presentation video, except it is a gig and it would take about 6 hours to upload to youtube. So this up coming week I am going to work on the final report for the project so I can move on and get ready for SCA submission. So short post for today, but it has been a long day.

Thursday, April 21, 2011

Oooooh Pretty....

Hey everyone,
So I've been up to two things this week. The first is the poster for the CS and CG@Penn Poster sessions. If you would like to see the poster, come by the SIG Lab from 2:30 to 3:00 on April 28th.
The second thing I did this week was get Maya rendering to work. Thanks to Igor, I was able to quickly teach myself a little mel and keyframe all the points I needed. I wrote out all the vertices in a diagonal fold and unfold and brought them into Maya. I then created a quick paper shader and put the paper over a ground plane. The video is below:


So Joe complained that there was not memory feed back or a crease mark left in the paper. So I am currently rendering out a new version with both those things. I also tried to get a dual color going, but I could not get it to work how I wanted. So unless people know how to assign two different colors to a polygon, I think it will remain one color for now. I tried rendering out my dog, but it is having problems. I will try to deal with them before my presentation.

So while getting maya rendering work I believe I figured out how to use rotational springs to procedurally add memory to the lattice. I create a rotation spring along the exact same axis of the crease that generated the change in memory. Since my rotation springs allow for more than 2 particles to affect, I push an entire face of particles onto this new memory rotation spring. I set the rest angle to something between 0 and Pi. Since the torque generated on each point is dependent on the distance to the rotation axis, larger torques are given to points closer to the axis. So a smooth curve out is created. You can reverse the direction or the degree of the curvature by changing the angle. It looks like this:



This image also has my crease texture along the diagonal that I'll be using for the animation later.

So this weekend I will be preparing my presentation and making sure that is all in order. After that I will take a look at memory and physical properties again for my final report. Almost there!

Thursday, April 14, 2011

Material Matters

Hey Everyone,
So this past week I've worked on two things: memory and material properties.

Memory has been a massive pain in the butt, which is surprising because I thought it would be easy to work with. In my previous post about memory my only somewhat successful memory attempt was done through relaxing the rest length of bend springs. I was relatively happy with that to capture a piece of paper that is incredibly curled up. But it was hard to get it to get slightly bent. So I spent a lot of time trying to get the rotational springs to be added procedurally but regardless of what I did it seemed like it would not work. So I decided to just hard program it and I realized that it required very slight adjustments of the rest angles of the rotational springs to get that slight curl. Take a look at the video below:

So in conclusion of the memory, you can get strong results for memory by playing with the rest lengths of bend springs and this can be done procedurally. However if you want to get slight curl due to moisture or it is light paper, you are better off putting rotational springs in there manually and tweaking them.

So when I say "material properties" I of course mean something that is more visual than something that is grounded in physics. I found this webpage : http://www.paperonweb.com/paperpro.htm and it has a great amount of physical properties of paper.
  • The major thing that you have to deal with here is the weight of the paper. So I spent some time playing around with the mass of my particles. What this did visually was it mainly affected how great the forces were acting upon the particles. Mostly this just slowed down or sped up the folding process. However because it changed the speed of the fold, it did make the paper slump or stiffen a little more than usual. So changing the mass definitely had an effect.
  • The second property that I deal with is curl. I talk about the curl in my memory portion above. This website lists three different types of curl with regards to paper. When I add rotational springs this is sort of like structural curl, where a difference in the fibers causes the paper to pop up. When I change the bend spring's rest length that is sort of like moisture curl, where fibers in the paper either collapse or expand due to exterior forces or moisture.
  • The third major property I deal with is the dimensional stability. Dimensional stability is basically how the fiber in the paper keeps the paper together and affects how it folds. This is akin to my spring constants. I spent a lot of time playing with settings of spring constants to get different affects. Reducing the constants of the shear and bend springs will make the paper much more cloth. Reducing just the shear springs will make the paper more like tissue paper. Reducing just the bend springs will make the act like it is more moist. Reducing the constants of the structural springs is just bad because then the paper no longer holds its form.
  • The last property I got from that website was formation. Formation is the alignment and distribution of the fibers in paper. I wrote code that offsets the points in the lattice by a random but clamped epsilon. However this did not seem to change much in my simulation. I think it would be more important if I worked in a very large lattice.
I've attached videos of some the presets I've created for my simulation and showing what I described above.







Next week I am going to just concentrate on rendering. I have a problem where the paper can be folded at odd angles, causing breaking. I need to look at Joe's Maya export code before I can come up with a firm idea of how to solve this problem. After I do the rendering I am going create my poster and get ready for my final presentation. Yay!

Friday, April 8, 2011

A Dog's Life

An update? Not on a Thursday night? Is this bizarro world? No. In the last post I did not get to put up any movies. So this morning I laid out everything I needed to fold the traditional dog model and wrote up the XML file. I made her a slightly larger lattice than I have been working with. She is 25x25 opposed to the 13x13 I've been working with. So here she is, my first complete model in my simulation:




I know the top edges on the head are a little weird, but that is because the folds are occurring at weird angles. So I am going to have to deal with that when I get to the Maya export and rendering. I think I can fix it when I get to Maya, otherwise I may just live with it.

Thursday, April 7, 2011

Beta-Max

Hey Everyone,
So this week I tried doing two new implementations of my rotational springs. The first one I did earlier this week was an implementation recommended by Steven Gray. Rather than just applying forces to the corner of the lattice these rotational springs apply forces to multiple points. I originally tried applying forces to the points that neighboring the rotation axis. However because the lattice is not incredibly stiff, it only moved those neighbor points across the axis and did not move the entire paper. So I changed the implementation so that all the points above the a rotation spring are affected. So basically an entire rigid body is folded here. This proved to have better results since the forces added on each point are proportional to the distance from the rotation axis. However I feel that it becomes much harder to control where points are moving with this method.

This lead me to the another new implementation. In this implementation I once again allow for multiple points for the torque to act upon. However it is only used when acting upon an edge rather than a corner. This way I can use only one rotation spring in a horizontal/vertical fold rather than two as I was doing in the past. I also setup an XML input method that makes sure that each torque point has a structural spring to help support it. I also make sure that the structural springs turn off when that rotation spring is not active because they can interfere with other rotation folds. Because I changed the XML format for this new rotation spring I spent an hour going through and updating my previous XML files, making sure each one still worked. Some of them did not, which helped me find bugs.

This was all leading up to trying to fold the traditional dog model. This paper: http://www.csc.calpoly.edu/~zwood/research/pubs/origamiCATA06.pdf shows intermediate steps folding the traditional dog. I was able to put together most of the folds for the dog, but it is not quite finished yet. I still want to make tweaks to it and try it on a slightly larger lattice. However I am now 95% sure that I can fold that model with my simulator, which is great. The traditional dog does have a squash fold in it, which does make it technically not pureland. So maybe in the future I can get other stuff working.

So this past week was also beta review. I think it went well. The major thing it did was change how I am going to approach the last few weeks. The first thing is no more GPU implementation. I am going to concentrate on getting memory and material properties worked out so I can put them in the report and on my poster. After I finish those I will use Joe's code for taking the jello cubes into maya and do a bunch of nice renders and animations for my final video. If I have time after that, which I won't, I'll try to get a simple UI built so I can draw out folds rather than writing the XML. So my schedule as it stands is:

April 8th- 14th
  • Memory
  • Material Properties
April 15-21st
  • Rendering
  • Poster
April 22nd-April 26nd
  • Presentation
  • Simple UI (Probably not)
April 29th and Beyond
  • Final Report
  • Commenting Code
I know this post did not have any videos in it, mainly because today was kind of an annoying day. Next post will have videos, including the folding of the traditional dog. So look forward to it.

Thursday, March 31, 2011

Forgetting and Moving Forward

Hey Everyone
So this past week I focused on prioritized folding, fixing bugs, and memory (opposed to what I said in my evaluation post where I said I would work on the GPU implementation and memory). I did not do the GPU implementation because I felt that I still had too many bugs for me to move over to the GPU just yet.

So I think that I figured out what was going on with the angles and the acos stuff. I also think it does not really matter, mainly since I am controlling the direction of the fold with the mountain and valley direction variable. I decided that I need to add an addition variable to my rotation spring just for finding the angles, because it is possible that there could be problems with stuff lining up. It may make it hard to autogenerate the rotation springs from a UI though.

One thing I wanted to do was add prioritized folding. There is a few reasons for this. One is that it lets me do more complex folds that were having problems when folding all at once. Another reason is that it allowed me to test out some other problems easier and find bugs. In addition to giving rotation springs priorities, they can also be activated and deactivated. This way they are all not moving at once. Another thing the rotation springs got were links to their structural springs along their moment arms. This allows them to disable them during folding because these structural springs can have problems with multiple folds. So the linear springs can also be activated and deactivated now. All these things really helped me debug stuff. So below is my first multistep fold, a pleat fold. Here I fold the paper in half diagonally and then fold the corner back to the center.



I then tried something a little more complex where I have to fold through multiple sheets of paper. Unfortunately it did not work out as well as I hoped. Strange things are happening. When I setup the creases like they should be on the second fold (mountain and valley), it does not fold at all. When I setup the second fold incorrectly (both valley folds), it folds, but then it explodes. Take a look below (I cut out the explosion):



So I still need to fix a few bugs here and there with that setup. But I am in general happy with out it worked out.

After all that I went back to my memory implementation. It is certainly interesting. Last week I had implemented completely new bend springs that add rotation springs when they are stretched or compressed by a certain threshold. However this caused nothing but explosions. So I brought it back and tried doing simple stuff. In my first attempt I had a 2x2 lattice with a rotation spring in the center and gave it an angle that was not 0 or Pi. This worked very well. So I tried creating a large lattice with a bunch of rotation springs along it horizontally to in theory make it curl. Here was the result:


Definitely the best way to describe this is as a "ghost". It actually kind of looks like a plastic bag in the wind. And I am very surprised it remained stable. So after this try I brought it back and tried a few other methods. I played with their angle, spring constants and the amount of rotation springs, but they all had their problems. Here is a video of a single line of rotation springs down the center of the paper. It is interesting that it pulls the middle of the paper up, sort of like pinching it.


So the adding of rotation spring to simulate memory are just not working as I would like them to. I am going to keep at it but I am not sure it is going to work. One thing I did try instead was to actually as the paper compresses or expands, the bend springs change their rest length depending on how they are handled. This actually produced pretty good results. As you can see the two corners are brought to the center, and when the force is removed (the jolt) it pulls back and rolls up. If I did not change the bend spring's rest length then it actually unfolds back to is flat state.



So as for next week I will continue on the memory and fixing the prioritized folding. If I have time I'll start the GPU implementation. Otherwise that will get pushed to after beta, which is unfortunate because I wanted to have it for beta review. I might also have to set aside time to do what ever prep / presentation I need for beta review.

Thursday, March 24, 2011

Self Evaluation

So Joe asks us to do a small self evaluation, taking a look at what we've done and where we want to be done in the future.

Taking a look at my original proposal, I as way too ambitious. It is a little ridiculous and I think I knew it. There is no way I am getting my simulator up and running perfectly along side a step by step UI in QT. Although as it stands right now, I do have a decent simulator with different integration schemes and things kinda folding on the CPU. I wish it was in the state I said it would be in the original proposal, but as it stands it is something that can be showed off. It is definitely a good base for a larger project in the future.

So the things I have are:
  • Cloth System (CPU)
  • Structure, Shear and Bend Springs
  • Rotational Springs
  • Simple Rendering with keyboard controls
  • Gravity forces
  • XML Schema and XML input
I also learned how crazy a cloth simulator can act sometimes. They are certainly very fragile things. I have mixed feelings about not being on the GPU. In a way it was a giant relief since CUDA is so insane sometimes. But I feel like I should be better at CUDA and I need more experience with it. I will be moving over next week, so we'll see how it goes.

So am I disappointed about the current state of the project? A little. Am I surprised? No.

Before I go on to talk about what I want for the future, I want to say that I don't want to kill myself over this project. I don't want to worry about a UI and other surface things that will hamper the more core part of this project. This project is bigger than myself and I'll probably continue it with origamists and the maybe even the PMML project.
Going forward I wrote down the features I want to get done by the end and I organized them into must haves and would be nice.

Must Haves
  • Bug Fixes
  • Simple GPU Implementation
  • Paper Memory and in Simulation Alterations
  • New Rotation Spring class (multiple force points)
  • Prioritized Creases for Ordered Folding
Would Be Nice
  • Implicit Integration
  • Sparse Matrix GPU Implementation
  • Simple UI
Now that I have the list above, I spread them out across the next weeks in a way I feel is somewhat realistically. I feel that the GPU implementation is the largest thing there, mainly because it involves a whole new program in some respects. The bug fixes are a strange thing because it could take any amount of time. Here is my schedule:

March 25th - March 31st
  • Simple GPU implementation
  • Memory
April 1st - April 7th (Beta Review)
  • Bug Fixes
  • New Rotation Spring class
  • Prioritized rotation spring
April 8th - April 14th
  • Implicit integration
  • Sparse Matrix GPU implementation
April 15th - April 2st
  • Simple UI
April 22nd - April 26th (Final Presentation)
  • Poster
  • Presentation
April 29th and beyond
  • Testing and benchmarking
  • Commenting Code
  • Final Report
So as you can see I front loaded all the tasks that I feel I must have to the next two weeks. I don't expect them all to be done, which is why the later weeks are lighter and have tasks that I feel I could live without. So I hope to have a simple GPU implementation and some kind of memory changing paper by the beta review, but I'll probably only have one or the other. Tomorrow I hope to get a lot of work done, so we'll see how it goes. I've also taken into consideration the timing of my other papers and projects for other classes, so hopefully I won't have time problems.