Spring creation and force calculation

Started by
97 comments, last by Mystery 19 years, 7 months ago
Quote:Original post by lonesock
I'm thinking of trying a simple Gauss Seidel relaxation on it (no springs, just rigid lengths).

Hmm, not bad. How about the conjugate gradient method? Food for thought?

Mystery: These are iterative methods for solving linear systems. Robust libraries are readily available. I've used the NAG-library routines for finding the minimum energy configuration for random fibre networks for example, and successfully I might add. NAG is commercial but there are others.

JD

[Edited by - JesusDesoles on August 27, 2004 3:11:00 AM]
Advertisement
Here is the link. It is an obj file. Rigid length sounds interesting. Do let me know if you can get good results out of it. Thanks in advance.

Quote:Original post by lonesock
Any chance you could host, then post a link to a .3ds or .obj copy of your mesh? I'd like to play with it. I'm thinking of trying a simple Gauss Seidel relaxation on it (no springs, just rigid lengths).

thanks,
Quote:Original post by JesusDesoles

Note, that if you calculate the rest lengths for the extra springs at the initial deformed state these new springs actually try to keep the deformed state intact. The rest lengths of the extra springs should be set as if the network was already flat. More specifically the rest length for an extra spring should be calculated as if the triangles spanned by the spring were already flat. Think about this.


I think you are right. But to calculate the rest length of the extra springs when it is flat seems rather difficult since it is this state that is unknown to me.


Quote:Original post by JesusDesoles
Again, if your network has no overhangs you don't need these extra springs. The advice you've been given concerning these extras is valid for correctly simulating the dynamics of a paper sheet which you're not trying to do. You're searching a way to better the tactics proven to work in the document restoration publication. More specifically you're trying to make the same restoration dynamics work for a more complex initial geometry.


Spot on. If I did not read wrongly, they are using a special method to acquire the 3d structure using a 2d setup. In this way, they have sort of a control over how the mesh is constructed. I am not quite sure what u mean by "overhang". Do you mean certain areas are overlapping?


Quote:Original post by JesusDesoles
Ok, now I'm worried about the rest lengths of your springs. You've simplified the mesh you get from your scanning procedure due to advice given in Spring force calculation. This advice was given to you on the basis of real time animation of spring networks. This is not what you're doing. Your document restoration system does not need to work in real time. The simplified mesh structure may not possess the spring lengths charasteristic for a flat network that your original dense network does (if your 3D geometry acquisition procedure is accurate enough, that is).

I suggest you load up your original network, set the timestep small enough for your integrator and see what happens. Again, don't terminate at the flat condition just to be sure. No extra springs, no bending stiffness, just the original topology, geometry and a very small timestep.



The simplification process is simply using the software that comes with 3D scanner that I am using to acquire the geometry of the stucture. There is this function called "Subsampling" which allows you to reduce the number of points of the structure. In fact, the original structure(I have yet to work on that) consists of more than 100,000 points. I subsampled it to 10,000 and later to 2,000 points(the lowest possible number allowable) after listening to some advice.


Quote:Original post by JesusDesoles
May I ask, are you working with the bunch that made the document restoration publication?



I wish I am but I am not. I am just using their paper as a reference. In fact, I tried contacting them but to no avail.
Quote:Original post by Mystery
But to calculate the rest length of the extra springs when it is flat seems rather difficult since it is this state that is unknown to me.

Exactly. There are ways around that but I'd stick to the original plan for a while longer.

Quote:Original post by Mystery
I am not quite sure what u mean by "overhang". Do you mean certain areas are overlapping?

Yes. If the network at some point of the simulation process contains overlapping regions these regions may not open up again. In effect you are searching the minimum total energy configuration of your network. For two dimensional central force networks simulated in three dimensions this minimum configuration is not unique. Read: your network feels just/almost as relaxed being flat as it feels overlapping itself.

Quote:Original post by Mystery
The simplification process is simply using the software that comes with 3D scanner that I am using to acquire the geometry of the stucture. There is this function called "Subsampling" which allows you to reduce the number of points of the structure.

This subsampling may distort the geometry such that the minimum energy configuration of your subsampled network is not the one you're looking for in the original geometry. You could try simulating the original system while we're waiting for the results from lonesock.

Quote:Original post by Mystery
I am just using their paper as a reference. In fact, I tried contacting them but to no avail.

Right. Is this for your own pleasure or are you working in a research project?

JD
Quote:Original post by JesusDesoles
Right. Is this for your own pleasure or are you working in a research project?

JD


I am working this as my final year project in my university. In addition to the removal of distortion, I am planning to do some image enhancement stuff as well but that would have to wait as currently I have this huge obstacle to cross. In fact, I am actually very new to computer graphics and image processing stuff thus pls forgive me if I am rather slow in understanding some of the concepts/terms you guys presented here.
I got the file, thanks.

I'll work on it this afternoon.
OK, here is the demo.

www.lonesock.net/FlattenDemo.zip
(win32, needs OpenGL)

I have modelled gravity, the ground, and a spreading force (I had to center the model around its centroid) to try to spread the pages out.

it seems that the solver is nice and stable, but the initial connector lengths are _not_ correct for a final flat solution, so it "jumps" after a while.

A possible solution: do the rigid constraint iterative solve until the model is within some error state:

* sum of the kinetic energy of the points?
* all points close to the ground?

Then you could switch over to a soft spring model and finish it out. Ideally you could do some kind of least squares error, but I'm dubious because the number of constraints on the edges far outweigh the in-page constraints. This seems to be a problem anyway, so it might be a good idea to reduce the mesh more on the edges than in the center.

let me know if I can help out (or provide some C++ source),
The initial spread looks great though it turns "bouncy" after a while. Can you tell more abt the spreading force that you have included? Is this what you mean by simple Gauss Seidel relaxation?

May I also know how did you go abt creating the "sticks"(I supposed that is the "springs" for my case)? The number you have is 10284 whereas the number I have is 5936

Thanks a lot.

P.S If you want the texture file, do let me know.

Quote:Original post by lonesock
OK, here is the demo.

www.lonesock.net/FlattenDemo.zip
(win32, needs OpenGL)

I have modelled gravity, the ground, and a spreading force (I had to center the model around its centroid) to try to spread the pages out.

it seems that the solver is nice and stable, but the initial connector lengths are _not_ correct for a final flat solution, so it "jumps" after a while.

A possible solution: do the rigid constraint iterative solve until the model is within some error state:

* sum of the kinetic energy of the points?
* all points close to the ground?

Then you could switch over to a soft spring model and finish it out. Ideally you could do some kind of least squares error, but I'm dubious because the number of constraints on the edges far outweigh the in-page constraints. This seems to be a problem anyway, so it might be a good idea to reduce the mesh more on the edges than in the center.

let me know if I can help out (or provide some C++ source),
Quote:
I've used the NAG-library routines for finding the minimum energy configuration for random fibre networks for example, and successfully I might add.


Can you provided some more details on finding the minimum energy configuration? How is this solved mathematically?
Hi, Mystery:

My 3-step plan:

1) recenter the model about the average of all point positions (this is the centroid since all point masses are 1.0: happens only once)2) every point gets a lateral accel (my spreading force), as well as gravity:   - AccelX = PositionX * 0.1   - AccelY = -10.0 (gravity)   - AccelZ = PositionZ * 0.13) do Gauss Seidel iteration(note: in my case Y is up, I had to tweak my data points)


my number of sticks is high because it contains redundant ones. I "generated" (via cut-n-paste in a spreadsheet) my stick list from the vertices of the triangles a-b-c. So each tri gave me 3 sticks, a-b, a-c, b-c. My loader takes care of duplicate sticks.

The Gauss Seidel method is simply a numerical method that solves for only one (or in this case 2) values at a time. But it keeps on looping. So in this case:

for i = 1 to NumSticks  with stick (i):    find delta vector for each end of this stick    move each end of this sticknext i


It is a really easy way of solving multiple equations. It is iterative because since I only look at one equation at a time, I tend to invalidate the other equations by fixing each one. Fortunately it continues to get closer to an actual solution each time, so you repeat this (hence it is an iterative solution method).

This is why JesusDesoles suggested the "conjugate gradient method", a much cleverer solution, but I am too much of a wimp to code one for a simple proof of concept. I do recommend further reading on the "Numerical Recipies" website (www.nr.com).

I believe the "bouncy" part is because the constraints (original stick lengths) are not actually solvable for a flat final configuration. This is why I recommended continuing with springs once you reach a certain point.

I would like your texture file, but I'm moving, so I'm not sure when I'll get a chance to work with it...when is your project due?

This topic is closed to new replies.

Advertisement