You know those little plastic building blocks with studs on top that everyone definitely doesn't call by a specific Danish trademark? Yeah, those. This makes parametric versions of them that you can 3D print.
Built in Godot 4 because why not. Real-time preview, STL export, and enough sliders to keep you busy for hours.
- Real-time 3D preview — tweak a slider, watch the brick morph. Instant gratification.
- STL export — export one brick or a whole kit. Your slicer will thank you.
- Parametric everything:
- Width, length, height (in studs/plates, because that's how we measure things here)
- Stud diameter, height, chamfer (yes, studs have chamfers now)
- Wall thickness (thicc or thin, your call)
- Anti-stud clearance and chamfer (the hole that receives the stud)
- Clutch rib radius (for that satisfying click)
- Horizontal play and axle play (tolerance is not just a personality trait)
- Brick types: Brick, Tile, Jumper (the holy trinity)
- FDM-optimized defaults — tuned for PETG because PLA is for cowards
| Parameter | Value | What it does |
|---|---|---|
| Stud diameter | 5.0 mm | Slightly thicc to account for plastic shrinkage |
| Anti-stud clearance | 0.15 mm | How much room the stud has inside the tube |
| Wall rib radius | 0.30 mm | The little bumps that make things stay together |
| Clutch offset | -0.15 | Makes the anti-stud tubes thicker so they don't snap |
| Horizontal play | 0.05 mm | How much smaller the brick is than the math says it should be |
| Axle play | 0.25 mm | For when you want to put a technic axle through it |
- Download the latest release for your platform from the Releases page
- Run the executable — no installation needed
- Click the + button to add a brick
- Fiddle with the sliders until it looks right
- Click Export Kit and feed the STL to your printer
- Open the project in Godot 4.x (you have that installed, right?)
- Run the scene (
Main.tscn) - Click the + button like you mean it
- Fiddle with the sliders until it looks right
- Click Export Kit and feed the STL to your printer
The generator uses Godot's CSG (Constructive Solid Geometry) system to build bricks from primitive shapes. The entire pipeline lives in BrickGenerator.gd and is dispatched from the generate_brick() function.
This function calculates the brick's outer dimensions based on parameters:
tw = (width × pitch) - (2 × horizontal_play)
tl = (length × pitch) - (2 × horizontal_play)
th = height_in_plates × plate_h
- pitch = 8.0 mm (center-to-center stud distance)
- plate_h = 3.2 mm (height of one plate)
- horizontal_play shrinks the brick slightly so it fits between adjacent studs
It then creates a CSGCombiner3D node and calls _build_dispatch(), which routes to the appropriate builder based on the brick type.
_build_standard_brick() — Used for the "brick" type:
- Creates the outer shell via
_add_rounded_solid()— a box with rounded corners (radius 0.8 mm) - Creates the inner cavity via another
_add_rounded_solid()withis_subtractive = true— a smaller box hollowed out from the inside - The cavity height is
th - wall_t(wall thickness subtracted from total height) - Calls
_add_clutch_ribs()to add friction ribs on the inner walls - Calls
_add_clutch_posts()to place anti-stud tubes on the bottom - Calls
_add_smart_studs()to place studs on the top surface
_build_tile() — Used for the "tile" type:
Same as brick but does not call _add_smart_studs() — tiles have no studs on top. The top surface is flat.
_build_jumper() — Used for the "jumper" type:
Calls _build_tile() first (flat base with anti-studs), then calls _add_smart_studs() with custom stud placement controlled by jumper_studs_w, jumper_studs_l, jumper_offset_x, jumper_offset_z, and jumper_stud_rotation. This allows placing a subset of studs at arbitrary positions — useful for half-stud offsets.
The entire brick geometry is based on an 8 mm grid:
- Studs are placed at
(x + 0.5) × pitchfor x in range(width), centered around the brick origin - Anti-studs are placed at
(x + 1) × pitchfor x in range(width - 1), centered at the midpoints between studs - This means the anti-stud grid is offset from the stud grid by half a pitch (4 mm)
For a 2×2 brick:
- Studs at (-4, -4), (-4, 4), (4, -4), (4, 4)
- Anti-stud at (0, 0) — one tube in the center, surrounded by 4 studs
For a 4×4 brick:
- Studs at (-12, -12), (-12, -4), ..., (12, 12) — 16 studs
- Anti-studs at (-8, -8), (-8, 0), (-8, 8), (0, -8), (0, 0), (0, 8), (8, -8), (8, 0), (8, 8) — 9 tubes in a 3×3 grid
Each anti-stud is a hollow tube created with CSGPolygon3D in MODE_SPIN:
- Outer tube: A rectangle spun around the Y axis — radius =
(6.51 - clutch_offset) / 2, height = cavity height - Inner hole: A slightly narrower rectangle subtracted from the tube — radius =
(stud_d + anti_stud_clearance) / 2 - Bottom chamfer: The inner hole is flared at the bottom (0.5 mm wider at the opening) to guide studs in smoothly
The wall thickness of the anti-stud tube is:
wall = (6.51 - clutch_offset) / 2 - (stud_d + anti_stud_clearance) / 2
With defaults: wall = (6.51 + 0.15) / 2 - (5.0 + 0.15) / 2 = 3.33 - 2.575 = 0.755 mm
Wall ribs (_add_clutch_ribs()): Small vertical half-cylinders on the inner surfaces of the outer walls. These press against the studs of the brick below, providing lateral grip. Rib radius is controlled by wall_rib_radius (default 0.30 mm).
Anti-stud grip: The inner diameter of the anti-stud tube is slightly smaller than the stud diameter, creating an interference fit. The effective grip depends on:
stud_d— how big the stud isanti_stud_clearance— how much larger the anti-stud hole is than the stud- PETG hole closure — printed holes tend to be ~0.3 mm smaller than designed, which effectively increases the interference
Between anti-studs: On larger bricks, the outer walls of adjacent anti-stud tubes form pockets that can grip studs laterally. The interference depends on:
- Tube outer radius:
(6.51 - clutch_offset) / 2 - Stud radius:
stud_d / 2 - Distance from stud center to tube center:
√(4² + 4²) ≈ 5.657 mm - Interference per side:
tube_radius + stud_radius - 5.657
- horizontal_play: Shrinks the entire brick by
2 × horizontal_playin width and length. Makes the brick fit between adjacent studs without binding. - clutch_offset: Enlarges the anti-stud tube outer diameter (negative values = larger tubes). Also affects the 1×N solid rib size:
(3.2 - clutch_offset) / 2. - anti_stud_clearance: Added to
stud_dto determine the inner hole of the anti-stud tube. Positive = looser, negative = tighter. - wall_rib_radius: Controls how far the clutch ribs protrude from the inner walls. Larger = more lateral grip, but can make assembly too tight.
Studs are created with CSGPolygon3D in MODE_SPIN with a chamfered profile:
- Base: full stud diameter (
stud_d) - Top: reduced by
CHAMFER(0.25 mm) for a beveled edge - Height:
stud_h(1.8 mm)
The chamfer helps the stud enter anti-studs smoothly and gives that authentic tapered look.
PETG behaves differently from PLA when 3D printed:
- Hole closure: Internal holes print ~0.3 mm smaller than designed. A 5.3 mm hole becomes ~5.0 mm actual.
- Stud accuracy: Studs print close to designed size (within 0.05-0.1 mm).
- Flexibility: PETG is stiffer than PLA, so interference fits need tighter clearances to avoid cracking.
This is why anti_stud_clearance is set to 0.15 mm (the hole is designed 0.15 mm larger than the stud, but prints ~0.15 mm smaller — creating a net interference fit), and clutch_offset is negative (to thicken the anti-stud walls so they don't snap under the interference).
- A computer (tested on a Dell Latitude with 8 GB RAM and no dedicated GPU — it runs)
- Time (brick tuning is a journey, not a destination)
- A 3D printer (or a friend with one)
- A slicer that supports STL files (they all do)
- Patience (first layer calibration is not optional)
- Material: PETG (tested with Sunlu, but don't blame us if your knockoff filament sucks)
- Nozzle: 0.4 mm (standard issue)
- Layer height: 0.1 mm (we like detail)
- Temperature: 235-245°C (your mileage may vary, adjust accordingly)
- Bed temp: 70-80°C (hot enough to stick, not hot enough to burn)
- Cooling: 30-50% fan (PETG doesn't need a hurricane)
- Wojciech Swat — Idea, execution, testing
- Fayez Akhtar — UI design and implementation
- The open source Godot community for making this possible
AGPL-3.0
This project is a parametric 3D model generator for interoperability with construction toy systems. It is not affiliated with, endorsed by, or connected to any construction toy brand. All trademarks are property of their respective owners.