Dynamic Chains, and lots of em


#16

The output of nCloth is animated vertices, not animated translate/rotate as is the case with a rigid system. The above workflow is basically making simple cloth objects “relatively stiff” then attaching rigid meshs to to the cloth( like buttons on a shirt ). With cloth one can make it stiff easily only for very simple meshes. The time to compute cloth stiffness goes up exponentially with mesh resolution, so it helps to keep the cloth as simple as possible. Usually this makes the the cloth simpler than the model we wish to render and the cloth will still deform a little thus the need in this case to attach a rigid mesh to the cloth surface and hide the cloth.

There is a rigidity attribute on the cloth that is essentially a rigid body solver inside the cloth solution, but it is not very practical for things like chains, as one would need too make each link a separate cloth object and I think it might get slow and have poor collision behavior( although I’ve not tried it ). The rigidity attribute can be useful in some cases, but it is not a substitute for a rigid body system, and often it works better if one keeps the mesh simple and relies on bend/stretch/compression resistance.

Duncan


#17

I did try using the concrete preset on low res poly links but like you said, I had to make each one an nCloth object and it wasnt very practical. Collisions worked okay with substeps close to 20 but I couldnt achieve free flowing rotations between the links as if friction was too high, but even with low friction values the problem still persisted.
Your method is far more efficient.

Is a RB solver something you guys will be working on in the future?


#18

awesome D, even better than Johns idea :wink:


#19

Hi Duncan,
I had a look at your nClothChainFast-solution and i think it is very smart, thanks!
One thing I have to solve though is an issue I only encounter when I rebuild your scene with a different chain-mesh (shorter and less follicles):

Compared to your nClothChainFast.ma scene my follicles freak out during fast and jerky chain movements. It seems as if they can’t keep track of the right normal direction.

I created them like you wrote, using your script after having created a clean mesh with clean UVs. Are there any tricks you can share to make them more “stable” during heavy mesh movement?

Thanks in advance,
Fridi


#20

I’m not entirely sure why, but it should fix the problem if you add divisions to the output cloth mesh, or instead you could smooth it. It might have something to do with the way triangle coords or normals are interpolated when the triangle is stretched.

Duncan


#21

Hi Duncan,

How could I apply your fast chain approach to a rope, basically a cylinder, rather than chain links? Thanks.

Tim


#22

A rope is easier. One need not handle the free compression of chain links or instancing links along the strip.

Just create a long skinny poly plane with subdivisions along its length (a strip of square quads), then make it nCloth, constrain and simulate as desired. You might not want any bend resistance on the cloth. To render a rope shape, you have a few options, although a simple technique is to extrude the output cloth(with history) to make a square tube, then smooth the result to make it a round tube. The finer detail on the rope could be handled with bump or displacement maps if needed. Another approach might be to paint a pfx stroke along the strip and convert to poly( or to nurbs curve and then model based on that ).

Duncan


#23

Thanks Duncan,

One problem…it’s collapsing at the end of the cube, seems to not keep its original volume. I have it constrained at one end and that end is keeping its volume but the opposite end collapses and flattens out. Is there a way to fix this?

Also, I’ll let you know what I’m shooting for, if it may make a difference. I’m looking for the best way to wrap a rope around a spool. Basically the spool, perpendicular to the rope, will be rotating, winding up the rope. The scenerio is the rope will manufactured by a machine and then wrapping on the spool. So, the spool will pulling the rope out almost. I hope that makes sense.

Thanks

Tim


#24

If I understand you correctly, it sounds like you are simulating on the extruded plane, rather than doing it downstream of the cloth. You want to simulate the flat strip, then extrude the output cloth mesh( not the input one) along the surface normals to give it thickness. (in terms of collisions you can use the thickness on the cloth node)

Duncan


#25

The spool animation should be as simple as:

  1. create nCloth strip
  2. make spool a passive collider
  3. do point to surface constraint of the 2 vertices at the end of the cloth strip to the spool
  4. keyframe the spool rotation and playback.

If you have stretching or collision problems, increase substeps and stretch resistance.

Duncan


#26

I think you’re right, I didn’t extrude the correct mesh initially. I went back and did the following…created a plane 1 by 20 with 20 subdivisions. Made that nCloth. Created cylinder and made that a passive collider. Constrained the 2 closest vertices to the cylinder using point to surface (I used transform before and that seemed to work too, would that matter?) Then ran playback, and it worked good. cloth wrapped around cylinder. Then I selected outputCloth1 and extruded that. Ran playback and seem to have the same problem, it keeps volume on top of the spool but as it drapes over the edges it flattens.

Thanks for the help, Duncan. Obviously, I’m a dynamics novice so please bear with me. I really appreciate the assistance.

Tim


#27

I think you are hitting a bug where the normals used by the extrude are not properly updated for the deformed cloth mesh. You can work around this by doing normals:softenEdge on the mesh before the extrude. This insures that the extrude has computed normals to work with.

   Duncan

#28

Hey Duncan,

I did the normals:softenEdge and I’m still getting the same results. I’m assuming that should be done to the outputCloth? Any chance I could send you a personal message with a file attached for you to take a look at? At the moment I don’t have access to a server to be able to share a link here for you to download.

Tim

tfahey1@yahoo.com


#29

Perhaps you got the ordering of the nodes wrong. Select your object and open hypergraph:connections. You should see:

outputCloth -> polySoftEdge -> polyExtrudeFace

The extrudeFace node should be using the localTranslate Z value.

Duncan


#30

Thanks, that seemed to work. I think the problem was that I was that I was clicking the little blue dot and then doing the extrude so extruding on global Y, I guess.

Can you make any suggestions to avoid self pass through as it wraps around the cylinder?

Thanks Duncan!


#31

Can you make any suggestions to avoid self pass through as it wraps around the cylinder?

Firstly, adjust the collide thickness to match the thickness of the rope. (set solverDisplay to collision thickness to better see it). If there is interpenetration then increase substeps on the solver node until it fixes things.

The extrude will be from the center of the cloth, so it will not exactly match the cloth position. For an exact match you can select faces on the output cloth mesh and do a transform component along the normal before doing the extrude. (you may still need the soften Edge before doing the transform component) You basically transform one way and extrude the other way. This way the geometry should closely match the collision boundary of the cloth.

Duncan


#32

lol or just tell him to wrap a modeled rope that fits perfectly centered :wink:


#33

Yeah, that is definitely easier when you want to model the rope, but for simple tubes I find this workflow is pretty easy( it sounds perhaps more complicated than it is).

Duncan


#34

Is there any way to change the proportions of the collide boundary? As I move the slider, the boundary expands both height and width, is there a way to adjust them individually?

And Collision Thickness only refers to collisions with the passive collider and the Self Collision Thickness is only collisions with itself? Is that correct?

Thanks, I appreciate the help!

@Howard…It’s not a rope, basically plastic tubing.


#35

There isn’t. The thickness is a radius of collision from the surface( in all directions ).

The resulting collision thickness is of course a combination of the values on the two objects colliding.

Self collide width scale is defined relative to the collision thickness, so for a value of 1.0 it would be the same. The self collision thickness is used for collision between components of an nCloth (or nParticle) object. We limit the thickness on a per collision pair basis to be no greater than the distance these pairs are separated at the start of the simulation. This keeps a thick self collision from exploding apart at the start frame. An interesting side effect is that one can use really high self collision width on a cloth (vertex self collisions for speed) and it can behave like a solid or thick substance instead of a thin shell.

Duncan