3D Printing, Maker, OpenSCAD, Programming

Print your own LEGO-compatible bricks

Given that I have a 3D printer and a five-year-old son, it was inevitable that I would eventually print some LEGO-compatible bricks.1 I knew that bricks were a popular “look what I can print” demo, but after I tried out a few of the popular printable LEGO-compatible models [1] [2], I found that none of them were designed accurately enough to reliably interlock with genuine LEGO bricks, and none of the libraries included support for any shapes besides the basic rectangular brick.

To solve this problem, I’ve written a LEGO-compatible brick generator that is more feature-rich than any other. It has support for customizing the following brick aspects:

  • Length, width, and height
  • Shape: brick, tile (smooth-topped brick), wing, slope (brick with an angled face), curve (brick with a curved face), or baseplate.
  • Size: LEGO or DUPLO
  • Hollow or solid studs (the little bumps on top of the bricks)
  • Horizontal rod holes
  • Vertical axle holes
  • Notched sides on wings so that the wing can be attached to a plate.
  • Slope/curve length/angle
  • Curve style: convex or concave
  • Double-sided bricks (studs on both the top and bottom)
  • Roadways: smooth sections on the top of a brick

These characteristics can combine to create millions of unique bricks. You can generate anything from this vanilla 2×4:

lego-brick

to this extensively customized brick that you’ll never be able to buy from LEGO:

lego-slope

This assortment of bricks contains examples of all of the available customizations:

customized-lego

But this is still just a tiny fraction of the possible permutations.

Here are a few bricks I’ve printed. I haven’t gone crazy with customizations, mainly because what I print is dictated by what my son asks for, and he’s only been requesting wings, wings, and more wings so he can build spaceships.

The script is available on GitHub, and I’ve published it on Thingiverse as well for easy customizing. (It’s by far my most popular Thingiverse model.) Download the script, print your own bricks, and send me a photo.

1. At the request of the LEGO corporation, homemade bricks should be called “LEGO-compatible bricks,” not “LEGO bricks.” FYI.

Standard

37 comments on “Print your own LEGO-compatible bricks

  1. Jason Gilbert says:

    Awesome, thanks for sharing your hard work! Can I ask what printer you have, or what to look for in a printer to make these blocks at good quality, I.e respectably good ‘snap’ when connecting with actual Lego blocks?

    • I have an Orion Delta 3D. I don’t know what to look for specifically, but on whatever printer you try it on, you’ll want to play with the stud_rescale parameter to get the studs to print at just the right size so they’ll give that satisfying snap.

  2. Andrew Ennis (Bath, UK) says:

    Hello,
    I don’t have a 3-D printer, but I need about 15 special size Lego window frames. I am building a 1:25 scale model of my own house, but the standard Lego windows available are too small for most of the windows on my model.
    Do you produce Lego-compatible bricks for people commercially?

  3. Jealous Dad, aka Heath says:

    Hi. I have really been dying to get some custom made pigeons to put on buildings in my cityscape? Would you be able to produce some 5-10 as an order? Thanks!

    • It’s maybe a few pennies cheaper, but the time commitment and the lower quality don’t make up for the price difference. If you can easily buy the replacement piece you need, you’re likely better off just buying it.

  4. Raoul Duke says:

    you are awesome for doing this! srsly.

    any idea/thoughts/leads how i could get/make/design 2×2 by 2×2 angle brackets with arbitrary angles of my choice instead of just the half-pi standard?

    • Sure, I wrote up an OpenSCAD script to generate angle plates: http://github.com/cfinke/LEGO.scad/blob/master/LEGO-Angle-Plate.scad

      This is the default output: a 90º plate with both sides 2×2.

      But you could make the angle anything. Here’s one with an angle of 45º and different size sides:

      Here’s the underside of one with an angle of 100º, a 2×3 base, and a 4×1 overhang:

      Depending on the size of the overhang, you’re limited to about 112º before it starts to get chopped off. This script doesn’t do plates with negative angles (the overhang jutting up from the base with the studs on the “bottom” of it), but it’s not hard to imagine that it could be modified to do so. Also, both sections of the plate are the standard 1/3 brick height. I think the real LEGO angle plates have the overhang as thick as a baseplate, but I didn’t have one handy to measure. I’ll find one and update the script if necessary.

      Actually manufacturing these is up to you — you could print them yourself (somehow) or order them from Shapeways or another print-on-demand service. They *should* work, but maybe do a test run before ordering a gross. :-)

  5. Matthieu Godbout says:

    Hello Mr. Finke, I really appreciate your work since it could help me imagine new set of LEGO-compatible bricks. You wrote on this page that the fit with LEGO bricks is acceptable to your 6-old son, but not satisfying to you. Why do you think so? Is it too hard or too easy too assembly or disassembly? Before I can verify your dimensions with my own prints (the MakerGear M2 I will use seams to reach as good accuracy as your Orion Delta), I would like to understand where your bricks show some defect. I thought the genuine LEGO bricks could have some subtle taper angles on their sides, on the sides of their studs and maybe elsewhere… Thank you.

  6. Leonard says:

    I would like to print some of the space lego from the late 1970’s and early 1980’s, the sets sell for a premium on eBay today and it would be amazing to have them printed again as lego no more make them. How does copyright work with LEGO designs, do the copyrights expire after X number of years? Is there anyone printing the 1970’s and 1980’s space lego currently?

    • According to LEGO’s legal department:

      “You can generally use them for your personal project or if nobody is making any money from it. Read the LEGO® Fair Play policy to find out more: http://aboutus.lego.com/en-us/legal-notice/fair-play/

      As I understand it, as long as you don’t post designs online that claim to be genuine LEGO bricks (thus, the “LEGO-compatible” disclaimer I used), you can create and print any brick designs you like for your own use.

  7. Martin Silsby says:

    Hi like what I have seen you have done. Since I am in the UK, could you give some details on the Orion Delta 3D printer. I don’t know what and it’s consumables. How long to print an item. Really looking at printing tools, head gear, food stuff, swords, sheds etc. Have you tried any of these sort of things. Thanks for the information and work you done will be checking out the links.

  8. Ben Weinberger says:

    I love it. Have you created a project to print heads with custom faces (such as from a JPG or something so that I can print faces of my family onto some lego heads and snap them onto lego bodies)? Also, how long would you printer take to print one head?

    • No, my printer can only print one color at a time, so custom faces are out of the question. You might have luck printing faces onto stickers correctly sized to fit exactly on a blank yellow LEGO head.

  9. Herman Reintke says:

    Hi Christopher,

    First : Very good lib thanks for your effort in This
    Working on my first custom made lego compatible servo block.

    Checking dimensions I of the blocks I noticed that you have a

    horizontal_hole_z_offset = (brand == "lego" ? 5.8 : 5.8 * 2);

    where on “lego bricks dimensions” google search found the measurement should be 5.6.

    Is there a specific reason for your library to use 5.8 ?

    • I based all of my numbers on physical measurements of the bricks I had in order to confirm the numbers I found online; it’s possible I mis-measured or typo-ed that number. I will check today and update the library if it’s wrong; thanks for the heads-up.

    • I re-measured four different bricks from different sets and got 5.8 for the height of the center of the horizontal hole each time. You’re right that the various sources online disagree on this value, but I feel confident that 5.8 is correct.

  10. Tanya A says:

    Hi Chris,
    Wow! What a cool dad! I am new to 3D printing so wanted to ask what programme one needs to use with your GitHub code. It is 3D-printer specific i.e. You import it into the software that comes with your 3D printer? Or is there a more ‘universal’ Programme?
    Thanks,
    T

  11. Christopher, this is awesome!!! Thank you for dedicating so much time to making this happen! I have a Mirco M3D 3D Printer http://www.printm3d.com. Your code printed a 2×2, 1/3 height, plate piece almost perfect! The top and studs were perfect, the size was perfect, but the bottom did not have enough space between the inner wall and the center circle to attach to normal LEGOs. So I am going to have to increase the space by lowering the size of the walls. I will post the new values for the Micro M3D and some pictures when I get it figured out. Again, thank you for the hard work!!!

  12. So I changed this variable

    wall_thickness=(brand == “lego” ? 1.05 : 1.5); // wall_thickness=(brand == “lego” ? 1.45 : 1.5);

    And I got a pretty good fit. One side is not holding tight, but the other side is.

  13. K$ says:

    This could be interesting for people looking for extremely hard to find pieces (e.g. Lego 47675/47676) that run for $20-$30 dollars a piece.

    Thanks for posting.

  14. Jørgen Wanscher says:

    Great with the stud_rescale option to fit the studs. On my ultimaker3 however the bottom holes do are too narrow. Do you have any already have plans to incorporate a hole_rescale parameter?
    I have seen the wall_thickness hack above, but I think a stud_rescale-like solution is better. Possibly with linking effective_hole_size = hole_size * stud_rescale * hole_rescale, so that they fit themselves perfectly?

    • It’s tricky, since on my printer, the bricks only fit together if the studs are rescaled and not the holes (and the holes aren’t one single object that can be rescaled, they’re just the absence of the other objects on the underside of the brick). I don’t have a satisfactory solution for this.

  15. Nils says:

    Is it also possible to design and print corner slope elements (convex and concave) like these: https://www.bricklink.com/v2/catalog/catalogitem.page?P=3675#T=C and these: https://www.bricklink.com/v2/catalog/catalogitem.page?P=99301#T=C ???

    And would it be possible to create elements with combinations of slope angles like a 3x2x1 element, that has a 45 degree slope on one side, and a 33 degree slope on the other side? These bricks are very important for complex roof geometries. It’s strange, that Lego does not manufacture them…

Leave a Reply

Your email address will not be published. Required fields are marked *