Position-based Elastic Rod

Please don't post Bullet support questions here, use the above forums instead.
Post Reply
DevO
Posts: 95
Joined: Fri Mar 31, 2006 7:13 pm

Position-based Elastic Rod

Post by DevO »

Hi All,

Right now I am trying to understand and implement "Position-based Elastic Rod" from here:
http://www-ui.is.s.u-tokyo.ac.jp/~ume/P ... icRod.html

The only problem is the most important Anisotropic Bending-twisting constraint.
(Equation 21 in the paper.)
How to compute position update for all the 5 points ?

Actually there are 3 constraint in one.
omega1 - omega1_goal
omega2 - omega2_goal
omega3 - omega3_goal

In the appendix there are derivatives with respect to 5 point but what is next ?
Apparently I am missing something.

Thanks in advance !
DevO
Posts: 95
Joined: Fri Mar 31, 2006 7:13 pm

Re: Position-based Elastic Rod

Post by DevO »

I finally got it now to work.

The solution was actually in "4. Variational interpretation of constraint enforcement" section of the paper, that I have ignored first.

By the way is this forum still active ?
bone
Posts: 231
Joined: Tue Feb 20, 2007 4:56 pm

Re: Position-based Elastic Rod

Post by bone »

I think a lot of people are still checking this forum, but few are posting new questions.
DevO
Posts: 95
Joined: Fri Mar 31, 2006 7:13 pm

Re: Position-based Elastic Rod

Post by DevO »

> I think a lot of people are still checking this forum, but few are posting new questions.

I was not active in thins field for longer time.
Are there any other active forums where one could ask such question ?

Of course not this one :)
Fortunately I was able to implement it and it run very stable now.
Actually one could drop random points in and it will recover to valid state, just as in the paper video.
The next step would to add Collision Detection and Response.
korzen303
Posts: 30
Joined: Thu Dec 19, 2013 12:13 pm

Re: Position-based Elastic Rod

Post by korzen303 »

Hi DevO,

would you be so kind and share your implementation?

I am researcher working on simulation of flexible surgical tools for cardiovascular interventions. In our group we have been using Cosserat Rod based on CoRdE implemenatation by J. Spillmann for a while now but the position based approach for elastic rod looks interesting.

Thank you in advance
millag
Posts: 1
Joined: Tue Sep 09, 2014 5:33 pm

Re: Position-based Elastic Rod

Post by millag »

Hi DevO,

Your work sounds very interesting.
I'm wondering how much time it takes for a simulation step, can the method handle stiff rods and what is the max time step you can use before the simulation gets unstable.

I'm asking because I'm currently working on curly hair simulation. My implementation is based on "Discrete Elstic Rods" http://www.cs.columbia.edu/cg/rods/. Unfortunately, due to the large amounth of rods it has to handle, it's very slow. There are 2 main sources for this - the energy minimization step described in the paper and the small timestep required when the rod stiffness is high. So I'm basically searching for alternatives.

Cheers.
korzen303
Posts: 30
Joined: Thu Dec 19, 2013 12:13 pm

Re: Position-based Elastic Rod

Post by korzen303 »

In case someone needs a working code for the Position Based Elastic Rods check this post:
http://bulletphysics.org/Bullet/phpBB3/ ... 93&p=36852
and the sources are here:
https://github.com/korzen/PositionBased ... ElasticRod
mobeen
Posts: 122
Joined: Thu May 05, 2011 11:47 am

Re: Position-based Elastic Rod

Post by mobeen »

Hi all,
Sorry for reviving an old thread but I m currently doing my own implementation for understanding of pos based elast. ic rods paper. Note that i have already seen sheproth and korzens code which are both implemented same way. I am stuck in calculation of material frame derivatives given in appendix eq. 43, 44, 45. From what I understand material frame is a 3x3 matrix. If we differentiate it with a 3x1 vector, we should get a 3x9 matrix. Assuming the matrix as D having elements D00, D01... D22 elements, and a vector p having px, py, pz elements the partial derivative will be dD00/dpx dD00/dpy dD00/dpz dD01/dpx dD01/dpy dD01/dpz dD02/dpx dD02/dpy dD02/dpz ... dD22/dpi dD22/dpi . dD22/dpz. From the two implementations, this appears to be a 3x3 matrix which is not what I expect.

The second issue is in eq. 44 when derivative of second material frame is calculated. The first term is a scalar 1/(|p01xp02|). It is multiplied to the term (I-d2 tensor_product d2). Since d2 is a 3x3 matrix, d2 tensor d2 will be a 9x9 matrix. Now this term is multiplied with a vector (p2-p1) which is a 3x1 column vector this multiplication is not possible. Both sheproth and korzen replace the vector (p2-p1) with a (p2-p1) cross product matrix?

Can anyone please shed some light on this?
mobeen
Posts: 122
Joined: Thu May 05, 2011 11:47 am

Re: Position-based Elastic Rod

Post by mobeen »

Ok I think all of the equations make sense now. The partial derivatives are wrt d1, d2, d3 from eq3. So these will be 3x3 matrices.
[EDIT]:OK It is mentioned in the paper that the author uses [A] where A is a vector to mean a cross product matrix so this sorts out the whole math and the solution is indeed a 3x3 matrix.
mobeen
Posts: 122
Joined: Thu May 05, 2011 11:47 am

Re: Position-based Elastic Rod

Post by mobeen »

A slight update. All constraints apart from bendtwist constraint work. In a couple of bend constraints I get singular matrix that causes problems. Any ideas on how to resolve this error?
mobeen
Posts: 122
Joined: Thu May 05, 2011 11:47 am

Re: Position-based Elastic Rod

Post by mobeen »

OK I have finally got it working.
The main problem was that my cross product matrix was not properly calculated. glm wants that we provide data column wise in column major format but I was giving it in row major.

Here is the snapshot of my implementation.
snap.png
snap.png (23.3 KiB) Viewed 27313 times
Post Reply