LEGO Brick Generator

OpenSCAD script to generate LEGO bricks of any size.


Creative Commons Attribution Noncommercial Share Alike

Commercial use is not allowed, you must attribute the creator, you may remix this work and the remixed work should be made available under this license.

Learn more or download attribution tags


I have included several example STLs generated with the script, but you can always make your own.

To create your own LEGO brick, just change the sizes in the makeLego command at the very bottom of the code to anything you want (and that your computer can render.) You can reduce the circle resolution for better render time by lowering the number on the very first line.

Adapted from the FreeCAD script at

Materials and methods

- OpenSCAD
- Computer with a good graphics card needed for larger bricks



Issues are used to track todos, bugs or requests. To get started, you could create an issue.


9dba0842816e1ff910251aa64ceab5aa?default=blank&size=40Ilya T. added this to the Π˜Π³Ρ€ΡƒΡˆΠΊΠΈ collection ago
4f4e1914393116410fc47ae311fa597a?default=blank&size=40Kreed22vR added this to the My Collection collection ago
8845e3fc7f47d42c4b0ddcd13819bed2?default=blank&size=40GrGin added this to the Lego collection ago
4fea67df080cad6ba66239f840cd7773?default=blank&size=40ISP.piraeus International School of Piraeus added this to the Educational collection ago
2fcdcd5eb716f5a864466394d01f1aa9?default=blank&size=40coffeefox added this to the Toys collection ago
9ca81106f0f1700ec779756bd49e4026?default=blank&size=40Timby tSomber added this to the Stuff collection ago
1d04affd2fadc8975327a9d220f0093d?default=blank&size=40Chris Pekar added this to the Random collection ago
A4195bf65020ddaf506accaee025deb4?default=blank&size=40Bob S added this to the Fun collection ago
186d130061c98dcb702da1b9f9d6da43?default=blank&size=40sw4280 added this to the 2print collection ago
1f250722c722cd2be77d2f2ef3336c75?default=blank&size=40Ovidio Garza MartΓ­nez added this to the Lego collection ago
28cdc85e7be01ec3dcbd1ff7fd2f7dc3?default=blank&size=40Tylera2001 added this to the make these collection ago
3063615ca0d1c94e83ffea72afe30666?default=blank&size=40stargazer added this to the Stuff to Make collection ago
1b83199840244a8c3d006aba6132c256?default=blank&size=40Kyle Baggott added this to the Cool collection ago
3c6c2817ce13f0e9a900dff9f76a7a5a?default=blank&size=40BrewNinja added this to the Things to make collection ago
4da953152f1870301e9f83f20f44fa33?default=blank&size=40Juan JosΓ© Carmona Martinez added this to the My favorite collection collection ago
4f06573d971770d61b3103dc3dae4023?default=blank&size=40karlo added this to the Lego collection ago
160d6c0299bbc4c115ed8c2afd53bd5a?default=blank&size=40Arny56 added this to the Toys collection ago
04b37c23903af16c6a9718edf8a1b4a8?default=blank&size=40Gun Guzel added this to the gun collection ago
54ee6656780ab0a0571abebba3c37aff?default=blank&size=40Arjen Breur added this to the Toys collection ago
4e3d7a407550fefbc4f8d04b4a5e2c8b?default=blank&size=40Etienne Kestelyn added this to the cool kid stuff collection ago
E63ea23cd8fccb2567797bae37b39c58?default=blank&size=40chapelmagine added this to the mine collection ago
2e11e35458874273c718d7ccaf3ffb74?default=blank&size=40Thomas Pakh added this to the To-Print collection ago
A2ad4e358d33dbb9be26b1fbcb31fd11?default=blank&size=40Fernando Miras Sosa added this to the Juguetes collection ago
E70e82831955aca249e2a4021b97b3d0?default=blank&size=40Jdesigns55 added this to the Want to make collection ago
80d665ce2d893d9b2e73663b305556a7?default=blank&size=40Ilkka Kiistala added this to the e1 collection ago
02a5aa315be5b16a840eeae7e71a09ee?default=blank&size=40kalfie7 added this to the Cool shiz collection ago
Mini leLee added this to the Toys For Josh collection ago
D77c1f3601e32ecc60acc9195824f59e?default=blank&size=40Mikhail Diatchenko added this to the Toys collection ago
769f0cd604c0cae942a52139df293821?default=blank&size=40ECA commented ago

Could this be used to make a long Block that is three nubs wide, but only the middle nub is present? As a long display stand for figures?

Mini img 1327E Panzer added this to the Lego Stuff collection ago
62803656a86a524a86a1fe9ea2111f3e?default=blank&size=40maffucci added this to the Lego collection ago
Efb59e027a40917dfd3e0a9233d4ccf7?default=blank&size=40Michael S. Schultz added this to the To print collection ago
C8630a6ff3d8d08ad00a021a5c4bd00f?default=blank&size=40Ml4824 added this to the OpenSCAD collection ago
70af42ca011fd18531d54723a18f26da?default=blank&size=40Nuke added this to the new collection ago
1be31faea46e530e1cfd4c78b8d0cf99?default=blank&size=40Shananers added this to the Lego collection ago
B4839cef53eefa3f12bc5d24d3b495ba?default=blank&size=40MavericksDesign added this to the Things to Make collection ago
1a13a31858c6cbbbb3145c175eeb28f0?default=blank&size=40Anthony Pionessa added this to the Random Cool Things collection ago
Fed263ebd2c98ac2a822a98fdc70e8ad?default=blank&size=40RJ Linn added this to the Lego collection ago
Mini bitmoji 20170903072746Andy Castille published this design ago