# What's the right setting for an array to fit a curve perfectly?

Even though I set the array modifier to fit curve and the object with the array modifier has it's origin on it's very center, it really doesn't fit quite perfectly. It either is too many or too few or just about perfect. I wonder if there is way to make it symmetric as well

• hmm, I see. So just eyeball the offset get it to look right? Welp, if it's the only way Commented Feb 23, 2022 at 13:17
• sorry my comment was wrong as Nathan said Commented Feb 23, 2022 at 16:45

To fit a curve without stretching, the array has to have the exact same length as the curve. Here, our cube is 1 unit wide, but our unit-radius bezier circle has a circumference of about 2 times pi. So there's no right number of cubes:

In order to perfectly match the circumference, we need to scale the mesh, which we could do to eye-- or, we could take advantage of a few curve settings to let Blender do this automatically for us:

By enabling stretch and bounds clamp on the curve, in properties/object data/shape, we're telling Blender that we want any curve deformed objects to start at the first control of the curve and stretch all the way around the curve to the final control (or back to the first control, for a cyclic curve like this.)

There are times when we don't quite want the whole curve, but we can still use stretch + bounds clamp, by creating stray vertices:

By creating a stray vertex (and, here, changing the array to a constant offset), it's a different bounding box that is being stretched to the curve, so we can use the position of that stray vertex to limit the end of the curve. If we wanted, we could use another stray vertex on the other side of our cube to limit the start.

Stray vertices don't get rendered, but if you don't want them around, you can follow this up with a mask modifier to get rid of any stray vertices you're using to control the curve.

• I didn't know about Stretch and Bounds Clamp, so thanks for that. Obviously, this is a much simpler/better answer than mine. I feel like your images might be a bit confusing due to the scale and distortion though, so I made this video to demonstrate the method with a setup more similar to OP's: i.imgur.com/H8VB62I.gif I was gonna edit your answer to add it but I wasn't sure about the etiquette. Cheers. Commented Feb 23, 2022 at 17:42
• @Kuboå I'm sure there are some people who would rather not see their answers edited, so it's probably a good idea in general to ask, but personally, I'm grateful for any edits. I figure it's all about getting good answers out there, and that works best as a team effort. Commented Feb 23, 2022 at 17:43
• This is what I'm looking for. Thanks man Commented Feb 24, 2022 at 12:15

You can do this by using the Constant Offset mode of the Array modifier. To make the copies fit exactly, you need to know the exact distance there should be between them, and to know that, you need to know the exact length of your curve, which you would then simply divide by the number of gaps between the copies you want to have (i.e, 1 less than the copies).

First, to get the length of your curve, you can use the Curve Tools addon that comes with Blender. Once that's enabled in Preferences > Add-ons, select your curve, go to N > Edit > Curve Info and click "Length", which will populate the box to its right with the value. Copy this number (you can simply hover over the box and press Ctrl+C), then go to your Array modifier settings, click into the appropriate Distance box, and enter [YourCurveLength]/[NumberOfTotalCopies-1]. For example, if you have a curve with a length of 14 and you want 6 copies, you would enter 14/5.

This will also naturally result in a symmetrical setup.

Additionally, if you wanted to offset the position of the first and last copies of the array, you could switch to Fit Length instead of Fit Curve, then do the necessary math work inside the value boxes to accommodate the new situation. In the example below, I moved my mesh object +2m on the X axis as seen in the Item tab, so for Fit Length I subtracted twice that amount from the curve length to trim from both sides, and for Constant Offset, I did the same (in parentheses) before dividing by the gap number:

• Could also be looking into using stretch+bounds clamp on your curve to auto-scale the array. Commented Feb 23, 2022 at 16:24
• @Nathan oh you're right I didn't notice the stretch + bounds clamp Commented Feb 23, 2022 at 16:44
• @Nathan I must admit I've never used those options, I don't know what they do. If you mean that's a simpler method, maybe you should post it as an answer? Commented Feb 23, 2022 at 16:55
• @Kuboå I should, but I'm lazy right now. Commented Feb 23, 2022 at 16:58