Generate Lego-like bricks, plates, and tiles of various sizes.
Update 3/6/2019 Various fixes, default adjustment changes, and support for post size adjustments on 2xN bricks.
What I hope sets this apart from other customizable Lego-like bricks available so far is a focus on creating STL files which will print well and fit with other bricks over accuracy to real Lego pieces. This manifests in several ways, including:
- Minor deviations from real Lego dimensions, in order to improve printer results. Commonly, this shows as thicker cross supports on 1xN bricks and wall thicknesses aligned for common nozzle widths.
- Studs in real Lego bricks are hollow and open underneath. I find they print better if we render them solid
- Options in the customizer where you can set small adjustments in the brick based on your printer and your slicer.
With this in mind, please read the following sections before using the customizer. They explain many of the options in more detail. Additionally, don't blindly download and print the sample STL brick files. That misses the point of the project. If you're not using Customizer or OpenSCAD to tweak the bricks for your environment, you're probably better off using someone else's pre-rendered brick STLs. These bricks are intended as a starting point, rendered using the default settings. Print them once, but then use them as a reference point for adjustments.
Note I only plan to support basic bricks. Look here for more exotic pieces.
This is still a work in progress, but it's far enough along to be ready for general use. I still need to create some adjustments for the inside of the brick, for how it fits the studs to a brick below it, and to reduce the thickness of the upper surface. Later, I want a 2.0 version that simplifies the adjustments based on feedback here. So, if you make a print, please leave a comment about how it worked!
Real Lego bricks have sizes based on a 1.6mm Lego Unit (LU), and .1mm Play Factor (PF), which helps bricks fit together better. The play factor is currently represented in the Customizer as the Wall Adjustment parameter. Bricks themselves are mesaured in "studs", where a stud is 5 Lego Units (8mm) across.
It is my belief the Play Factor is removed from both edges of a wall, such that bricks have walls 1.4mm thick (one lego unit minus the play factor on both sides). An example 1x2 brick would then be 7.8mm across the short way and 15.8 across the long way, where we lose the .1mm play factor once from each direction, when it was subtracted from the outer part of the walls.
Most people will do better adjusting the play factor (Wall Adjustment) to end up with an exact multiple for the nozzle diameter of their printer. .4mm and .5mm are common.
A .4mm nozzle would want to use a .2mm adjustment. This will create 1.2mm walls (1.6 - .2 from both sides of the wall). For a 2x1 brick, this would create a brick that is only 15.6x7.6, rather than the standard 15.8x7.8.
A .5mm nozzle would want to use only a .05mm adjustment. This will create 1.5mm walls (1.6 - .05 from both sides of the wall). This creates a 2x1 brick that is 15.9x7.9, rather than the standard 15.8x7.8.
To help with the different final dimensions, there is a further Gap Factor adjustment used for tweaking the whole brick size. The Gap Factor amount is subtracted from both edges of a brick. I find 3D printed bricks need slightly larger gaps than real Lego bricks.
A .4mm nozzle would then want a negative value here of around -.1mm. This would expand the example 2x1 brick back to the standard 15.8x7.8 dimensions. Because of the extra gaps for 3D printed bricks, I recommend -.089mm.
A .5mm nozzle would use a Gap Factor of .05mm to match standard Lego bricks. Again, because of wanting extra gaps when 3D printing, I recommend .061mm.
Finally, remember the whole point here is you can experiment and adjust for your printer and slicer. My recommendations are just that: recommendations. Find out what works in your environment and use that. The defaults here are based on testing and feedback from a .4mm nozzle.
I need feedback
This is still a work in progress. If people will share their results, letting me know what worked for them, I will update this text and the defaults in the .scad file to use better defaults based on these real-world results.
On Posts and Ridges
Lego bricks (not plates) have small ridges .3mm thick on the inside which help grab and hold the studs of the piece below. It's important to keep the limitations of the printer in mind for these elements of the brick; it's difficult for printers to get exact dimensions with the ridges, making adjustments ineffectual. Adjusting the radius of the posts, however, is very effective... often too much so, where you can quickly break to the fit to other bricks.
In short: these adjustments are very needed, but also not ready yet. I need to think more on how to help people find good values to use.
Finally, real Lego plate pieces do not uses ridges. However, in my test prints so far, plate pieces have a very loose fit. I may need to add the ridges back for better fit; this would be in keeping with the philosophy that allows me to take liberties from real Legos in order to achieve better-working prints. However, I'm not quite ready to make that commitment. Further testing is in order first.
Update: I've re-worked some things so adjustments can now be made for the posts. As always, experiment and find what works for you. Be careful here; small adjustments go a long way. The ridge adjustments still need some work.
There is still some debate on how tall the stud cylinders should be. There are arguments for 1.6mm (1 Lego Unit), 1.7mm, and 1.8mm.
It is my belief studs are 1.8mm tall, but this value includes the "Lego" text emboss. Thus, 1.7mm is a good practical value to use when 3D printing. This belief is reflected in the default settings here. Studs are 1.8mm, but there is a .1mm default adjustment which makes for 1.7mm as the final result.
There is also an option to adjust the stud radius. I've found printed studs often feel too small, rather than too large, and a (very small) negative number can work well here.
This is still a work in progress. Expect updates over the next few weeks, especially to the default customizer options as I figure out what prints well for me, and hopefully based on feedback from others.
For future enhancements, I'm working more adjustments for ridges, posts, and studs. I'm also considering adding arches inside full-height bricks as an option for printers that can't bridge as well. For plates, I want to make thinner top walls, to allow more space for the studs. I also want to create bases, where the brick is solid inside, with no posts or ridges.
See something you can improve? Send me a pull request on github! Also keep in mind: the github code may at times be ahead of what is available here as work progresses.