Grasshopper

algorithmic modeling for Rhino

I'm a Mathematician who studies knots, among other objects. One of the ways to study a knot is to keep the radius of the rope used to tie it fixed, while shrinking its length as much as possible. This process is called "Rope Length Minimization." After a few days of experimenting, I've been able to implement this with Rhino/Grasshopper/Kangaroo! Here's a little animation of a randomly drawn knot shrinking to it's rope-length minimizer:

https://www.youtube.com/watch?v=KPLIXqTgO4Y&feature=youtu.be

Here's the grasshopper definition: RandomKnotMinimizer.gh

It basically works by converting the knot into a set of straight lines (i.e. finding a polygonal approximation). Then it converts each of those lines to a spring with zero rest length. At the same time, a set of forces are applied that keep every segment of the knot at least one unit of distance away from every other segment. The program is then put into motion while the strength of each spring is gradually increased. 

I'd love to see other strategies to do similar kinds of things. I thought the Line-Line Kangaroo component can be used to repel each edge of the knot away from every other, while keeping their lengths fixed, but I couldn't get that strategy to work.

Views: 6918

Replies to This Discussion

Hi all,

Thanks for this very interesting discussion, sorry I've not got involved sooner.

Several years ago I had some discussions with Ken Baker (the author of the wonderful sketchesoftopology blog) on this topic.

Inspired by the work of Rob Scharein on Knotplot, I had a go at generating minimal energy knots using a repulsion force with an inverse cube strength. The tricky thing I found then was that (as you also found) if the repulsion also acts between nearby neighbours, this acts like a bending resistance, trying to straighten out the cable.

Repulsion with a (power law based) falloff vs Collisions which only kick in below some distance threshold (plus tightening or thickening) will give different minimal shapes, but I think both could be interesting.

David - you are correct that the line-line force (and also line-line collisions in K2) acts not only orthogonal to the line segments - it is actually based on a capsule - a cylinder with hemispherical caps. This is because collision between capsules is actually considerably simpler to calculate than between cylinders with flat ends (since essentially you are colliding surfaces composed of swept spheres, and checking collisions between spheres is simply a distance check).

Attached below is a definition for minimizing knot lengths using Kangaroo 2 and the new Collider component. It uses the 'Ignore' input to get rid of the collisions between consecutive segments (or between each segment and the one n segments along) which cause the unwanted bending resistance. During the process of making this definition I discovered and found a bug in the K2 collider component, so you'll need the newest build I put up today on Food4Rhino.

I also found this MathOverflow discussion on the topic - might be good to have a look at the linked paper there.

Attachments:

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service