Here is a setup that does snapping wires...
Snapping wires from Sam Hancock on Vimeo.
Wires are pre-cut and the cuts get constrained together, in DOPs a sop solver removes points from the constraint groups based on how much the edge length is stretched. The tricky part about this is that the groups have to correspond exactly so that the edges get constrained together properly...
In SOPs before the sim, each line gets cut in two with a carve SOP. One side of each cut is put into a group, and the other side in another group. I use these groups in the constraint in DOPs to constrain the cuts together. Also, the points in side 1 of the cuts has a 'partnerPoint' attribute which stores the point number of the point on the other side of the cut. This is so that the groups can be rebuilt later.
In DOPs there is a SOP solver to remove points from the groups. For one side of the cut, the edge length is compared to the rest edge length, if it is longer than a threshold the point is removed from the group. The second group is rebuilt using the first (now modified) group and the partnerPoint attribute.
The hipnc file is here
Snapping wires from Sam Hancock on Vimeo.
amazing i just think about this effect
ReplyDeletethx you make me a sence!!