# Putting chains on hexagons

Hi

I am trying to fit chains into the lines of hexagons connected together by rings.
Since they are of different lengths they have different number of repetitions. My solution is to divide the lengths into 5 different domains, since chains have a bit of wiggle room and don’t necessarily need to be stretched out completely to fit, but should be max within the thickness of the chains.

Was wondering if there is a better way to do this, either by not having to divide into different domains manually, or maybe a more functional way to fit different repetitions of chains into the rings.

Thanks

Chain hexagons.gh (49.2 KB)

The built-in curve division options let you divide either:

by segment distance/length (resulting in a different length for the last segment unless the curve divides by that length perfectly),

or

by number of segments (giving no direct control over the length of those segments).

If instead you want to divide a curve into some unspecified whole number of equal length segments, automatically choosing this number of segments in order to get them as close as possible in length to a given value,
you can do it like this:
(making use of the automatic casting of a number to an integer by the ‘N’ input)

1 Like

Thank you! I will check this method out!

Thank you so much for the solution, it works great