Modeling an elastic net

Grasshopper with Kangaroo will get you started - see this post with GH definition: