Monday, April 16, 2012

Tearing in Cloth

Hello, couldn't update this weekend, so multiple updates today. Over the weekend, implemented tearing in cloth using the Stretch constraint. The stretch along the edge multiplied by stretch scaling factor is compared with the tearing threshold of the cloth to determine whether the cloth should tear. The stretched edge determines where the cloth should tear off.

The following steps are performed:
* Compare with tearing threshold (depends on cloth material)
* If greater than the threshold, get the edge to be broken off. Select one vertex from this edge.
* Duplicate this vertex and draw an imaginary plane perpendicular to the edge.
* Triangles containing the selected vertex which lie above the plane are assigned to the duplicate vertex, while those that lie below the plane are assigned to the original vertex. If a triangle has vertices which lie on either side of the plane, then the one with the higher value of dot product with the normal is given preference.
* Neighbors and faces are adjusted as per the above step.
* Distribution of mass among vertices is changed.
* The Stretch and Bend constraints are updated considering the new neighbors.

Following the above steps, tearing is achieved. Special cases are handled so as to not get orphan vertices, where vertices are not connected to any edge.

Below are few results from the simulation



There are few artificats at the end of the simulation which has to be handled. This might be caused due to the way orphan vertices are handled.

No comments:

Post a Comment