Studs
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"
);- studs = true ensures that studs are generated on the top surface.
- studType = "solid" defines the default solid stud geometry.
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"
);- studs = true enables the top studs.
- studType = "hollow" defines them as hollow ring-shaped studs, typical for Technic-style parts.
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"
);- false or "none" → no shift (default behavior)
- "x" → shift along the X-axis
- "y" → shift along the Y-axis
- true or "xy" → shift along both axes
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]
);- Stud padding is enabled by studPadding = [4, 2, 1, 0]
- 4 plates of blank space is applied to the left side (first value).
- 2 plates of blank space is applied to the right side (second value).
- 1 plate of blank space is applied to the front side (third value).
- 0 plate padding is applied to the back side (last value).
- Studs will only appear in the region not covered by padding.