Units

Units used in MachineBlocks.

MachineBlocks Base Unit

The MachineBlocks Base Unit (mbu) defines the fundamental proportions of all bricks and components in the library. By default, 1 mbu = 1.6 mm, ensuring LEGO®-compatible scaling. In most cases, this value does not need to be changed — it is set internally and applied automatically.

Most geometric parameters — such as wall thickness, stud diameter, and other part dimensions — are expressed as multiples of the base unit. Brick dimensions, however, are specified in grid units, which are themselves derived from the mbu value. By default, the grid unit is defined as 5×5×2 mbu, representing one 1×1 plate.

Only a few fine-tuning parameters (such as certain offsets or tolerances) are specified directly in millimeters.

For example, a 1×1 plate measures:
This corresponds to 8 mm × 8 mm × 3.2 mm in real-world dimensions.

Grid Unit

The MachineBlocks system is based on a 1×1 plate grid. All brick dimensions are defined as multiples of this grid unit, similar to how LEGO® elements are measured. The grid unit itself is derived from the base unit (mbu) and, by default, equals 5×5×2 mbu — representing the proportions of a single plate.

This consistent, modular grid ensures that all parts align precisely when combined in larger assemblies, allowing for seamless stacking and interlocking between plates, bricks, and Technic components.

When defining a part, you specify its size using the size parameter in the following format:

machineblock(
    size = [width, depth, height]
);
Each dimension is expressed as a multiple of the 1×1 plate:

Real World Unit (mm)

Adjustment parameters in MachineBlocks are specified directly in millimeters (mm) and are not affected by scaling. This ensures that small calibration corrections remain consistent, regardless of the overall brick size or scale factor.

Because 3D printers are rarely perfectly accurate, printed parts may differ slightly from their modeled dimensions. These discrepancies can result from factors such as material shrinkage, nozzle diameter variations, or layer height inaccuracies.

By using adjustment parameters — such as baseHeightAdjustment and baseSideAdjustment — you can fine-tune the brick’s final printed dimensions to achieve a better fit and more reliable assembly.

The following image shows a cross-section of a building block, with the red area indicating the portion that has been removed by adjustment.
LEGO is a registered trademark of the LEGO Group. MachineBlocks is not affiliated with or sponsored by the LEGO Group.