Get Started
How to 3D print your first LEGO compatible brick using the MachineBlocks SCAD library.
Install OpenSCAD
OpenSCAD is software for creating solid 3D CAD objects.
It is free software and available for Linux/UNIX, MS Windows and Mac OS X. Visit openscad.org to download the latest version.
Download MachineBlocks Library
The free MachineBlocks OpenSCAD library provides you with SCAD scripts for creating 3D printable STL models of LEGO compatible bricks and enclosures.
You can either clone or fork the GitHub repository or download a ZIP archive with the latest snapshot of the library.
Clone / Fork Repository
The MachineBlocks OpenSCAD library is available on GitHub.
Download Snapshot
Download the latest snapshot as ZIP archive.
Regardless of whether you have cloned the repository or downloaded the ZIP archive, you should find a machineblocks folder containing at least the following subfolders:
machineblocks/
Subfolder | Description |
---|---|
dev | Used internally for development and testing the library. |
examples | A collection of SCAD scripts to generate standard LEGO and LEGO Technic bricks. |
lib | The MachineBlocks OpenSCAD library |
Open Example File
Let's start with printing a classic 4x2 LEGO brick. Open the file examples/basic/brick-4x2.scad with OpenSCAD. You should see the following:
Render and Export
Before we can export the model as STL file we need to render the scene. Press F6 or click Design -> Render in the menu.
Depending on your computer this can take a while.
Now that we have rendered the scene, we can export the model as STL file by pressing F7 or clicking File -> Export -> Export as STL ... in the menu.
Import into Slicer
Now that we have the STL file, we can import the model into the Slicer software of our choice. We have tested different configurations on multiple printers, and the following settings work well:
-
Nozzle Diameter
0.4 mmThe models are designed to be printed with a 0.4 mm nozzle. Depending on the precision of the printer, you may need to adjust some parameters to achieve the desired clamp force of the bricks. -
Filament
PETG or PLAWe have tested the models with both PETG and PLA filament. PETG is slightly more flexible and durable, so the bricks hold up better, especially after prolonged use. -
Layer Height
0.2 mmThe models are optimized for a layer height of 0.2 mm. Depending on the precision of the printer, you may need to adjust the height of the brick using the baseHeightAdjustment parameter to get as close as possible to the height of an original LEGO brick. -
Supports
NoneFor most models, no supports are required at all. If a model requires support structures, these are usually already included in the model itself. However, for very few models, the supports must be activated in the slicer. -
Infill
15%It is recommended to print all models with 15% infill. -
Bed Temperature
HighThe bricks have a very small contact surface with the printing plate. A high bed temperature, especially for the first layer, is therefore highly recommended to prevent the brick from detaching during printing. However, the exact temperature setting depends on the printer and filament used. -
Nozzle Temperature
MaxIt is recommended to use the highest possible nozzle temperature specified by the filament manufacturer so that the extruded filament is very fluid. Otherwise, it can easily happen that the already applied filament tears off during the printing process. A high nozzle temperature can also improve the adhesion of the first layer. However, the exact temperature setting depends on the printer and the filament used.
Happy Printing :)