
“It’s by far one of the most complex algorithms we’ve ever written, and I’m a fan of simplicity in programming,” Baraff says. The algorithm that the team developed to trace and analyse all the intersections, determine the regions, and decide what to do is extremely complex. Outside the region, the cloth wants to push apart.” The cloth points inside the region want to attract their buddies, pull back through, and get out. And inside the circle, all the points have gone through the other cloth. Both pieces of cloth have this symmetric region inside the circle. If you look at the line of that intersection, you’ll see that it’s a circle. Now, throw a ball on the top piece of cloth and push down until it goes through the bottom cloth. He offers a way to think of this mathematical process visually: “Imagine that you have two pieces of flat cloth floating in space an inch apart. Our system does a geometric analysis of the intersection it traces all the lines to understand what it means.” Untangling cloth Sometimes a region of cloth needs to push in reverse.



The system understands, though, that pushing apart is not always right. Usually you keep cloth apart with the springs between. “Then, it determines that this region has gone through that region. “The system literally finds and traces all the intersections, and finds regions of the cloth surface,” Baraff says.
