Created on: 2025-11-08 ; Revised on: 2025-11-08
Customizable LEGO interface
Scripts for creating LEGO-compatible bricks with customizable top pins and bottom entries.
Available in two formats:
- Python script (
create_brick.py) for Blender 3D - OpenSCAD script (
create_brick.scad) for OpenSCAD
Files are available on:
Usage
Blender (Python)
- Open Blender 3D
- Open the Scripting workspace
- Load
create_brick.py - Edit the options at the top of the file
- Run the script
OpenSCAD
- Open OpenSCAD
- Open
create_brick.scad - Edit the options at the top of the file
- Press F5 to preview or F6 to render
- Export as STL for 3D printing
Options
Both scripts use the same variables:
pinCount: Array [width, length] - How many top pins in each dimensionentryZ: Height of the block - 2mm for plates or 8.2mm for normal brick sizeprintTopPins: Set totrueto add pins on top of the brickprintBottomEntries: Set totrueto add hollow entries underneath for connecting other bricks
Examples
2x6 brick (top and bottom)
Blender (Python):
pinCount = [2, 6]
entryZ = 8.2
printTopPins = True
printBottomEntries = True
OpenSCAD:
pinCount = [2, 6];
entryZ = 8.2;
printTopPins = true;
printBottomEntries = true;
![]()
10x10 plate (only top)
Blender (Python):
pinCount = [10, 10]
entryZ = 2
printTopPins = True
printBottomEntries = False
OpenSCAD:
pinCount = [10, 10];
entryZ = 2;
printTopPins = true;
printBottomEntries = false;
![]()
Applications
These scripts are particularly useful for:
- Creating interfaces between LEGO and custom structures
- Making non-standard size bricks
- Creating custom base plates
- Integrating LEGO elements into your 3D printing projects