Get Started

How to 3D print your first LEGO compatible brick using the MachineBlocks SCAD library.

Generate 4x2 Brick Model

Let's start with printing a classic 4x2 LEGO brick. Open the following code snipped with the MachineBlocks Online Editor by pressing the yellow button below.
A model for a 3D printed LEGO brick in OpenSCAD
//Import MachineBlocks block() module
use <machineblocks/lib/block.scad>;

//Generate a classic 4x2 Brick
block(
    baseLayers = 3,
    grid = [4, 2],
    knobSize = 5.0, //Reduce this value if the knobs do not fit into a LEGO brick or only with great difficulty
    sideAdjustment = -0.1,
    heightAdjustment = 0.0 //Reduce this value if the base of the brick is too high
);

Render and Export

Before we can export the model as STL file we need to fully render the scene. At the bottom left of the screen
  1. Press Full Render
  2. Press Export STL
The model for the 3D printed LEGO brick is exported from OpenSCAD as an STL file

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:
The STL model for the 3D printed LEGO brick is imported into the slicer software

Printing

As with most prints, the first layer is crucial for success. The columns inside the stone in particular can easily peel off if the first layer has not been printed cleanly. It is important that the printing plate is clean and the nozzle is free of debris. A good first layer looks like this:
The first layer of a 3D printed LEGO brick
For a relatively long time, the columns inside the brick are only connected to the printing plate via a very small area. This can be seen very clearly in the following picture. You can also see filament residue on the edge of the brick, which was caused by an unclean nozzle.
The pillars of the 3D printed LEGO brick are only connected to the printing plate by a small surface for a long time.
A critical moment is when the columns are connected to the brick via thin helper lines. These helper lines are used for stability and as a base for the top slab.
The pillars of the 3D printed LEGO brick are connected to the housing by thin helper lines.
Et voilà, the stone is finished. Not the best result, because the printing was interrupted so often for the photos, the quality is only mediocre.
The finished 3D printed LEGO brick
Even if the print didn't turn out perfectly, the brick fits very well on the LEGO plate, and the accuracy of fit compared to original LEGO bricks is also very good.
The 3d printed LEGO brick fits well on the original LEGO bricks
Happy Printing :)
LEGO, the LEGO logo and the Minifigure are trademarks of the LEGO Group.