I've uploaded a new version to deviantart (same link, just changed the fils). It now has a target segment length instead of simple attraction, and making waves is better now since there is also a minimum length (so they repel if the get too close to each other).