# Kangaroo qstn: Find largest cylinder that will fit

Hi all,

I’m trying to find the largest cylinder that can fit inside this closed chain. The plan is to increase the diameter of the cylinder until the chain links are colliding with their neighbors. I need SollidCollide (rather than FlowAlongCrv + Collision: ManyMany), because the links might twist/slide somewhat, affecting the allowable cylinder.

And a side question - is there any documentation about using Entwine to organize the Goals? Does the Branch order/configuration have an impact on results?

1 Like

@DanielPiker - does this seem like something Kangaroo could do?

Hi @declan

I don’t think this will work with SolidCollide - the meshmesh collision in Kangaroo has never been great, and for this many meshes of this detail I wouldn’t even try.

It might work to model them as collections of cylinders though with the ‘Collider’ goal - it’s faster and more stable than SolidCollide. Do you have the center curve of a link?

Another possibility might be to simulate just the interaction of 2 or 3 links with a rotational symmetry constraint.

The path structure of the Goals input doesn’t affect the actual solving behaviour in any way. It’s just that in the regular (non-bouncy) solver, the Output keeps the same Tree structure as the Goals input.

Here’s a start at this, showing the use of Collider

chainfit.gh (18.6 KB)

next step - add the central expanding cylinder

4 Likes

and here’s one that lets you expand a central cylinder with a slider
chainfit2.gh (24.1 KB)

The N used in that initial Curve Divide component will affect the accuracy (how many cylinders used for each link).
Unfortunately there isn’t currently a way to set different strengths within one Collider object, so the central cylinder is as hard as the links, and if you increase its radius far enough it will cause the links to start pressing into each other.
Ideally we’d want a way to make the big cylinder lower strength but the links very stiff.

edit- here’s a way to achieve this, just doubling up the Collider, one with high strength and just the links, and one with low strength and the big cylinder included.
chainfit3.gh (20.7 KB)

Thank you Daniel! Unfortunately the real project is not a circular cross-section, but I will pick this apart and see if there’s any way to Frankenstein a solution. I really appreciate you taking the time to put this together!