nHair and nConstraints


#1

Hey,

I’m trying to nConstrain two nHair systems to each other. Basically I created two parts of a curve. One bottom part and one top part. Both parts having their individual hairSystem. Then I want to connect them to each other with a nConstraint so they act as one hair. Then I want to simulate the cutting of the hair by breaking the nConstraint by some force or geometry.

The creation of the hair system and the nConstraints is fine. The cutting effect also works. The problem is that I don’t get the right behavior of the nConstraint. The two components stay connected till they break however the top hair rotates around the bottom hair. With polygons I would use the bend attribute on the nConstraint but that works on edges and obviously that doesn’t work on curves.

Does anyone has an idea on how to solve this? Maybe another technique. Basically I need the similate the cutting of multiple hairs. I hope my problem is clear. If not II’ll try to create a video to illustrate the problem.

Thanks in advance!

Ralph


#2

To maintain the bend resistance over a constraint currently you would need some overlap between the connected hairs. If you are constraining points you would want to overlap exactly one segment with the vertices exactly exactly overlapping where the last two vertices are constrained to the first two vertices of the second hair. If instead of points you constrain edges then then the overlap could potentially be less than a segment… the vertices on each hair constrain to the nearest point on the other edge. (a simple setup would be to make both nComponents All elements of type Edge, then on the constraint use maxDistance connection method with a small maxDistance)

There is a bend strength on the constraint currently but this only works with nCloth currently where you constrain two edges together.(it then looks at the angle of one face to another) Optionally you might use nCloth quad strips instead of hair and constrain the edges while enabling bend on the constraint.

One other solution if you don’t want any overlap might be to create a 3rd hair system consisting of short two segment “splints” (non-rendering) between the two hair systems then constrain between all three systems.


#3

Thanks Duncan!

This helps me a lot!

Ralph