Distribution Tool

Boxshot lets you distribute objects, so they have the same distance between them or their parts. In order to distribute objects in Boxshot you need to select them, then right click one of them and click Tools->Distribute... or click the same in the main Boxshot menu.

Distribution tool window will pop up where you can configure the following:

  • Distribute - lets you select what exactly to distribute, you can choose between minimums, centers, maximums and free space;
  • Along axis - here you select an axis that will be used for distribution;
  • Align to - here you let Boxshot know the bounds of distribution, you choose between selection, scene and fixed distance;
  • Distance - lets you specify the distribution distance if you selected Distance in the Align to dropdown above.

The distribution tool does a simple thing: it sort all the objects along the selected axis, then fix the first and last ones (unless you selected distance in the Align to dropdown) and then distribute the rest of the objects between these two, so their minimums, centers or maximums are on the same distance one from another.

If you selected Distance, Boxshot uses just the first object along the selected axis and then use the distance value you entered as a distance between the objects' minimums/centers/maximums.

Finally, if you selected Free space in the Distribute dropdown box, Boxshot does the same for free space between the objects. Unless you selected Distance, Boxshot will distribute the shapes in the selection or scene bounds. If you selected Distance, Boxshot will make sure the objects have exactly the space you need between each other.

All the changes are done in real time, so you can see the modified scene right after changing distribution parameters. Once you are happy with the result, you can simply click OK, otherwise click Cancel to revert to the original scene.

If you need to distribute objects along several axes, simply apply the distribution tool several times: once per each axis.

Scripting

Here's how you can do the same using Boxshot scripting:

var params = {
    distribute: 3,
    axis: 0,
    alignment: 2,
    distance: 3
};
tools.distribute(scene.selection, params); 

You pass indices in most of the parameters, the indices must match the dropdown options you see in the tool window. For distribute these are:

  • 0 - distribute minimums;
  • 1 - distribute centers;
  • 2 - distribute maximums;
  • 3 - distribute free space.

For axis these are obvious:

  • 0 - X axis;
  • 1 - Y axis;
  • 2 - Z axis.

Finally, for alignment these are:

  • 0 - distribute in selection bounds;
  • 1 - distribute in scene bounds;
  • 2 - distribute using the distance specified.