How to array objects evenly across a grid, with objects centered in each grid square, evenly spaced corner to corner.

I answered my own question; here's the math:
a.    Subtract 1 from the number of grid spaces in the dimension you wish to array across, and determine the divisors of that number. (For instance, if your grid is 36 spaces across, google “divisors of 35” to yield divisors 1, 5, 7, and 35, which are the numbers of columns that will fit evenly across that space, corner to corner, with each column centered in a grid space. If the number of spaces happens to be prime, it means that every space must be occupied. )
i.    Set one of the divisors as the Relative Offset Factor for the Array modifier in that dimension.
ii.    Adjust the Fixed Count to evenly distribute the objects across the grid corner to corner.

1 love
Reply
  • Martin Bergwerf replied

    Hey Jeff, great initiative.

    Not to say anything about your method (apart from the fact that you gave a bad example: 71 is a prime number), what works, works, but...

    I'd take the opposite approach (but it depends on the situation you are in)...

    Say I have a 'pillar' of 1 grid unit and 7 grid units of space before the next pillar (we only need one direction at the time, as you pointed out).

    Then if I want 9 pillars, I make the grid 9 x (1 + 7) - 7 units wide.

    In an image (with 6 pillars):

    Pillars_01.png

    • 👏
    2 loves
  • Omar Domenech replied

    Math is great but I tend to just wing it, if it looks like it works I'm fine with it. I'd say don't be afraid to take that approach as well sometimes, it's all fake in CGI anyways. But yeah, better stick to doing as Martin says though. 

    • relatable
    1 love
  • Dwayne Savage(dillenbata3) replied

    I guess I'm the lazy one. I just make a plane the dimensions I want then use loop cut(Ctrl+R) and set it to the number of columns I want then delete the vertices on the right and top side(Assuming you start from bottom left). Then use instance on vertex. If you're not familiar with this then. 

    1. Move column to first vertex. I use snapping to vertex. Note:Column's origin will be placed at each vertices of the plane. So plan accordingly. Also you can turn off rendering for original column.
    2. Select column, shift+select Plane, and Ctrl+p->Object
    3. Object tab of properties editor under Instancing panel, click vertices.

    1 love
  • Jeff Combs(MrMuffinMan) replied

    Thanks for calling me out on the bad example, Martin!

    I got my spaces mixed up with the dimensions in meters (72 meters across with 2 meter tiles = 36 spaces. The number should have read 35 spaces, to yield divisors 1, 5, 7, and 35, which are the numbers of columns that will fit evenly across that space, corner to corner. I'm sure there are much better solutions that I'll learn in time, but this one worked for the particular problem posed  in the tutorial.

    1 love
  • Adrian Bellworthy replied

    Yeah I'm with Omar, ultimately with CG it just needs to look good.
    It may be that an uneven distance between pillars looks far more appealing with a certain camera angle.

    1 love