Skip to content

Arrange designed trays

A removable tray lets you take a set of pieces out for play. Decide its contents and compartment sizes first. Once you have two to four complete tray designs, BGI can compare arrangements in the game box: beside each other, stacked where their rims support it, or a mixture of the two.

This is a different decision from automatic compartment design. solve arranges the inside of automatic grids. explore moves already designed trays while preserving their contents, dimensions, and dividers.

In a manual project’s assemblies list, a tray looks like this partial entry:

- id: token-tray
kind: tray
construction: open_grid_box
assembly: glue_allowed
side_clearance_mm: [1, 1, 1, 1]
members: [tokens]
interior:
id: token-compartment
kind: compartment
clear_mm: [40, 50, 25]
contents: [tokens]

Its clear_mm measures usable interior space. BGI adds the floor and wall thickness to find the outside size. The four positive side clearances are additional removal space on the left, right, front, and back.

Add every tray’s full interior and an initial placement in a valid layout.mode: manual, construction_mode: local_groups project. The manual layout guide explains compartment trees and positions. An existing plastic box remains a container, not a manufactured tray.

For a manually specified stack, layout.layers defines ordered starting heights and the height available to trays starting there. Two independent stacks may have different support heights, so these height budgets can overlap even though the actual trays must not collide. Each placement names its layer; an upper tray names the lower tray as supported_by. Supported stacking requires matching outside footprints, a continuous supporting rim, and contact at the correct height. BGI checks a straight upward removal path and records which trays must come out first. The project-file reference gives the fields.

For exploration, your source project must contain two to four constructed trays. With exactly two trays, it may also contain up to eight existing closed containers. BGI keeps those containers in place and tries new tray positions; the initial manual tray positions are normally not constraints on this search. Three- and four-tray searches do not yet accept existing containers.

Terminal window
bgi explore game.bgi.yaml --output tray-layouts

The search tries both orders in X and Y rows and a stack for two trays. With fixed containers, it also shifts these compact arrangements to discrete positions along box and container edges. The default search budget rises from 6 to 256 attempts; --budget N can adjust it up to 1024. With three trays, BGI also tries a pair stacked beside the third; four trays add paired and three-plus-one stacks. To keep tray X/Y positions, repeat --anchor-tray TRAY_ID for each tray that must stay where it is. BGI shifts each arrangement to the first anchor and rejects it if any other anchored tray misses its declared origin. It still checks box fit, clearance, support, construction, and cutting. Anchors do not fix tray layers, resize interiors, regroup contents, or search arbitrary tray shapes.

Open tray-layouts/README.md for the comparison. Each successful candidate already has a complete bundle in a directory such as candidate-001/. Open its preview/layout.svg and README.md to compare footprints, layers, and removal order. Unlike solve, this command produces candidate drawings and cutting files during the comparison.

Each candidate also has a saved recipe, such as tray-layouts/candidate-001.json. Keep it with the source YAML and candidate bundle. If you need to regenerate its cutting files after calibration, build from that recipe:

Terminal window
bgi build game.bgi.yaml --solution tray-layouts/candidate-001.json --output insert-bundle

Use a filename actually listed in the report. Changes to the tray construction, fixed container positions, or any anchored tray’s source origin require a new exploration; a kerf adjustment can normally be applied while rebuilding. Continue with material calibration and cutting and assembly.

If no arrangement is returned, read the rejection reasons. Stacking needs compatible footprints and supports, and rows need room for the trays plus their removal clearances. Trying all supported arrangements does not establish that every possible arrangement has been ruled out.