Studs

How to configure brick studs in SCAD scripts.

Default Studs

By default, studs are enabled in all bricks, and the stud type is set to "solid". This means you don’t need to specify the studs or studType parameters if you want the default behavior — the brick will automatically include solid top studs.

However, if you wish to explicitly define these settings, you can do so as follows:

Example

use <../machineblocks/lib/block.scad>;
include <../machineblocks/config/config.scad>;

machineblock(
    size = [4, 2, 3],
    studs = true,
    studType = "solid"
);
In this example:
If you omit the studs parameter entirely, it defaults to true. Likewise, studType defaults to "solid". You only need to specify these parameters if you want to change them (for example, to "hollow" or to disable studs altogether).

Hollow Studs

Hollow studs are the type of studs commonly used on Technic bricks. They are shaped like open rings instead of solid cylinders, allowing better compatibility with Technic pins and reducing material usage while keeping the same dimensions.

To create hollow studs, set the studType parameter to "hollow".

Example

use <../machineblocks/lib/block.scad>;
include <../machineblocks/config/config.scad>;

machineblock(
    size = [2, 1, 1],
    studs = true,
    studType = "hollow"
);
In this example:
Hollow studs are ideal for combining Technic and standard brick elements, maintaining compatibility while offering more versatile connection options.

Stud Shift

By default, studs are positioned at the center of each 1×1 brick segment. In some special cases — for example, when creating jumper plates or offset connection elements — you may want to shift the studs so they are centered between two grid segments rather than directly on one.

This can be achieved using the studShift parameter. Studs can be shifted along the X-axis, the Y-axis, or both, depending on the desired alignment.

Example

use <../machineblocks/lib/block.scad>;
include <../machineblocks/config/config.scad>;

machineblock(
    size = [2, 1, 1],
    studs = true,
    studType = "hollow",
    studShift = "x" // Possible values: false or "none", "x", "y", true or "xy"
);
In this example:
Stud shifting is most often used for jumper plates (1×2 plates with one centered stud) or offset connectors, allowing half-stud alignment while maintaining full compatibility with the MachineBlocks grid.

Stud Padding

The studPadding parameter defines how much blank space (without studs) is left on each side of the brick before studs are generated. The value is specified in grid units, meaning it is expressed as a multiple of a 1×1 plate.

studPadding can take one, two, or four values, depending on how precisely you want to control the empty space:

Example

use <../machineblocks/lib/block.scad>;
include <../machineblocks/config/config.scad>;

machineblock(
    size = [8, 4, 1],
    studs = true,
    studPadding = [4, 2, 1, 0]
);
In this example:
Use studPadding to create bordered plates, partial stud supports, or specialized structural elements where studs should only appear in selected regions.
LEGO is a registered trademark of the LEGO Group. MachineBlocks is not affiliated with or sponsored by the LEGO Group.