<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/11261" />

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2016-08-03T18:21:07+00:00</updated>

	<author><name><![CDATA[Real-Time Physics Simulation Forum]]></name></author>
	<id>https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/11261</id>

		<entry>
		<author><name><![CDATA[Dirk Gregorius]]></name></author>
		<updated>2016-08-03T18:21:07+00:00</updated>

		<published>2016-08-03T18:21:07+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37943#p37943</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37943#p37943"/>
		<title type="html"><![CDATA[Re: Implementing Efficient Simulation of Inextensible Cloth]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37943#p37943"><![CDATA[
Yup, looks like it!<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=14">Dirk Gregorius</a> — Wed Aug 03, 2016 6:21 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[mobeen]]></name></author>
		<updated>2016-08-03T02:52:38+00:00</updated>

		<published>2016-08-03T02:52:38+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37939#p37939</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37939#p37939"/>
		<title type="html"><![CDATA[Re: Implementing Efficient Simulation of Inextensible Cloth]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37939#p37939"><![CDATA[
Hi Dirk,<br>   Thanks for a prompt responses. IZIRC when I started opencloth you referred me to this very paper and his PhD thesis. Thanks to archives, is this the thesis you are referring to?<br><a href="https://web.archive.org/web/20121027055749/http://www.ronyfx.com/ronygold/AdrianGoldenthalThesis.pdf" class="postlink">https://web.archive.org/web/20121027055 ... Thesis.pdf</a><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=8124">mobeen</a> — Wed Aug 03, 2016 2:52 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dirk Gregorius]]></name></author>
		<updated>2016-08-02T18:04:13+00:00</updated>

		<published>2016-08-02T18:04:13+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37937#p37937</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37937#p37937"/>
		<title type="html"><![CDATA[Re: Implementing Efficient Simulation of Inextensible Cloth]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37937#p37937"><![CDATA[
I am totally out of this, but I remember there is a bunch of additional information in the PhD. I cannot find a link right now, but I have a local copy if you PM me.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=14">Dirk Gregorius</a> — Tue Aug 02, 2016 6:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[mobeen]]></name></author>
		<updated>2016-08-02T08:15:37+00:00</updated>

		<published>2016-08-02T08:15:37+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37936#p37936</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37936#p37936"/>
		<title type="html"><![CDATA[Implementing Efficient Simulation of Inextensible Cloth]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37936#p37936"><![CDATA[
Dear all,<br>  I am trying to implement the paper by Goldenthal et. al. (<a href="http://www.cs.columbia.edu/cg/pdfs/131-ESIC.pdf" class="postlink">ESIC</a>). I have already seen <a href="http://www.bulletphysics.org/Bullet/phpBB3/viewtopic.php?f=6&amp;t=1279&amp;start=75" class="postlink">this existing thread</a> where the author of this paper and Erin, Dirk and others shed some light on the implementation of this method as well as its similarities to Non-linear Gauss Seidel style methods. I have read the paper but still I believe I do not understand it completely. I hope those with experience with this paper's implementation can shed some light or direct me to relevant resources (like demo source codes etc.) that might help. <br><br>So far based on my understanding (from the SIG98 Baraff and Witkin's physics based modeling course notes, <a href="https://www.toptal.com/game/video-game-physics-part-iii-constrained-rigid-body-simulation" class="postlink">this tutorial series</a> and <a href="http://www-users.cselabs.umn.edu/classes/Fall-2015/csci5980-pba/" class="postlink">this University of Minnesota course material</a>). I have also setup a <a href="https://github.com/mmmovania/ConstrainedDynamicsExperiments" class="postlink">github repository for these experiments</a> here for others to try this.<br><br>The following is how the constrained based Lagrangian dynamics is implemented. I will be solving all constraints at once as in the original paper using Eigen instead of Pardiso. <br><div class="codebox"><p>Code: </p><pre><code>void constrainedForwardEulerStep(ConstrainedSystem *system, double dt) {    forwardEulerStep(system, dt);    projectPositions(system);    projectVelocities(system);}</code></pre></div>ProjectPositions is defined as follows<br><div class="codebox"><p>Code: </p><pre><code>void projectPositions(ConstrainedSystem *system) {    int n = system-&gt;getDOFs(),        m = system-&gt;getConstraints();    static VectorXd c(m);system-&gt;getConstraintValues(c);     static MatrixXd J(m,n);system-&gt;getConstraintJacobian(J);    static MatrixXd Mi(n, n);system-&gt;getInverseInertia(Mi);    MatrixXd A = J*Mi*J.transpose();    VectorXd lambda = solve(A, -c);     static VectorXd dx(n);    dx = Mi*J.transpose()*lambda;        static VectorXd x(n), v(n);    system-&gt;getState(x, v);    system-&gt;setState(x + dx, v);}</code></pre></div>And ProjectVelocities is defined as follows<div class="codebox"><p>Code: </p><pre><code>void projectVelocities(ConstrainedSystem *system) {    int n = system-&gt;getDOFs(),         m = system-&gt;getConstraints();    static VectorXd x(n), v(n);    system-&gt;getState(x, v);    v = v * 0.995; //global dampening        static MatrixXd J(m,n);    system-&gt;getConstraintJacobian(J);        static MatrixXd Mi(n,n);    system-&gt;getInverseInertia(Mi);        MatrixXd A = J*Mi*J.transpose();        VectorXd b = -J*v;    VectorXd lambda = solve(A, b);        static VectorXd dv(n);    dv = Mi*J.transpose()*lambda;        system-&gt;setState(x, v + dv);}</code></pre></div>This is how its all defined in the course notes and it works fine. You can try the demos in the github repository. <br><br>Now I looked at the ESIC paper in particular their algorithm 1 on page 4. It seems that there will be three loops in it. The outer loop for the number of solver iterations, the middle inner loop for iterating over all constraints and the inner most for strain limiting as shown below. Kindly correct me if I am wrong anywhere? Note that this is not implemented yet put this is how it will be implemented if I have understood it clearly?<br><div class="codebox"><p>Code: </p><pre><code> void FastProjection(ParticleSystem* system, float dt) {   //allocate memory for X0,Xt,Vt, dx, C, J, Mi;     //get initial values    system-&gt;getInverseInertia(Mi);    system-&gt;getState(Xt,Vt);   //outer solver iteration loop   for(int j=0; j&lt;MAX_ITERATIONS;++j ) {            X0 = Xt+dt*Vt; //take initial unconstrained step      system-&gt;setState(X0,Vt);      for (int i=0; i&lt;constraints.size(); ++i ) {         const Constraint&amp; c = constraints[i];         float strain(0);         do {            //calculate strain            Vector2d delta = X0[c.p1]-X0[c.p0];     strain = delta.mag() / c.rest_length;                              //obtain lambda by solving linear system             system-&gt;getConstraintJacobian(J);            system-&gt;getConstraintValues(C);            Jt=J.transpose();                         MatrixXd A = J*Mi*Jt; //from eq. 7             VectorXd b = C;             VectorXd lambda = solve(A, b);             static VectorXd dx(n); //from eq. 5             dx = Mi*Jt*lambda;                         X0 = X0 + dx;              system-&gt;setState(X0,Vt);        } while(strain &gt; STRAIN_THRESHOLD);         } //end for all constraints     }//end for all solver iterations      V = (X0-Xt)/dt;   system-&gt;setState(X0,V);} </code></pre></div>So this way, we are solving for each constraint one by one but not all constraints at the same time. We then find the amount to move (dx) and correcting its position, and then checking the value of strain to remain within the desired threshold. is this correct? Unless I am missing anything, I cant possibly think of a way to obtain strain at a point without iterating through the constraints?<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=8124">mobeen</a> — Tue Aug 02, 2016 8:15 am</p><hr />
]]></content>
	</entry>
	</feed>
