Fancy Bricks OpenSCAD Lego Brick Builder
by kresty, published
Liked ByView All
Give a Shout Out
If you print this Thing and display it in public proudly give attribution by printing and displaying this tag.Print Thing Tag
Updates, cylinders weren't connected and some of the fudge factors were off when I started "production" for L3-G0... Values now work well for ABS on my Flashforge version of Replicator.
Need a Lego compatible brick with studs on 6 sides?
FancyBricks is yet another OpenSCAD module to make Lego brick
compatible shapes. I needed to do some things that some of the other things don't do, like fractional bricks. Also some of the other modules weren't playing well with my actual Lego bricks after I printed them! I'm building special bricks for my Lego R2-D2 (L3-G0 has a Blog and Youtube channel.
I'm also building another couple modules off of this for angles and other cool shapes that'll be posted in a bit.
Tagged "work-in-progress" because you might need to tweak the fudge factors for your printer, however I'm not sure I'll expand it. Also the cylinders are work fine, but my printer doesn't print them in a very optimized fashion, not sure if it's the slicer or what.
Though I included a couple .stl files, FancyBricks is intended for you make your own "special" brick using OpenSCAD. It's fairly easy to do your own thing, and if you forget, there're comments in the fancybricks.scad file.
I've noticed that different materials (PLA/ABS) seem to have different tolerances, so you may need to play with the "fudge" factor to get a good fit. Bump up STUDDIAMETER if the studs are loose in a real Lego brick. Bump up WALLWIDTH if a real Lego brick is loose when plugged into the bottom of a FancyBrick.
My printers seem to have a little roughness. I print them with a raft if they have tubes on the bottom (my plate isn't apparently sticky enough otherwise). Then I press them onto a real Lego brick to get them to fit. Once that's done, I try fitting my bricks together.
Skip the first steps if you've played with OpenSCAD and know how libraries behave.
- Get OpenSCAD if you don't have it already, http://www.openscad.org/
- Copy fancybricks.scad to some folder on your machine.
- Either use a real library location, or to KISS, just make a new document and save it in the same folder as fancybricks.scad. (or just look at one of the other scad files).
- Enter something like this into your OpenSCAD script (on the left)
- Press F5 (Design->Compile). You'll see your normal 3x5 brick 6 plates (2 bricks) tall!
- To make OpenSCAD create an STL file, you have to render it first, press F6 (Design->Compile and Render)
- Design->Export the STL.
Sometimes its easier to see your brick's shape if you turn on the edges, View->Show Edges.
brick() takes a ton of different parameters. The normal ones are length, width and height, in Lego studs for length/width and plates for height. 1,1,3 creates a "normal" 1x1x1 brick.
brick() is most useful for making more interesting shapes, such as when you need to plug things together in strange ways or parts are misaligned by a 1/2 brick and so on.
Lego blocks aren't exactly their specified size, they're a little smaller so that they can fit next to each other without too much pressure. Additionally different printers behave differently, so you may need to tweak the constants in the library for your needs.
ANTISNUG makes the brick a tiny bit narrower so that 2 bricks side-by-side might have a chance of fitting. If you're bricks are too "tight" sideways, try increasing that.
STUDSANTISNUG makes the studs a tiny bit skinnier for similar reasons. If your studs don't fit in other bricks, try bumping that up a tad (or dropping it if they're loose).
The other dimensions are also exposed, but hopefully you don't have to tweak them too much.
I try to make them "fit" in a normal Lego brick. If that works, they'll probably snap together. My printer is course enough that I need to work them a little to get them to behave, and, of course, they're not as precise as a real Lego brick, but they seem to get the job done.
In addition to making really strange sizes, you can put studs on any face (though I'm not gonna claim you can print them very well, my SquareStudBox almost works on my printer. You can also remove the studs from the top. (studs & studsFront/Back/Left/Right/Bottom booleans)
Particularly for odd sizes, you can chose where the studs are centered or shoved to one side. You can also pick if partial studs should be included. (Often partial studs are too skinny to be useful, but sometimes they might be interesting). (partialStuds and centerStuds parameters)
Your brick can also have a flat bottom if you want. Or maybe you just want to get rid of the tubes for some reason, you can do that too. (hollow and tubes).
From the library:
// length: "x" size in Lego studs (default 4)
// width: "y" size in Lego studs (think width of 1x1 brick) (default 2)
// height: "z" size in Lego plates (brick is 3, plate/tile are 1) (default 3)
// center: true if you want it centered (excluding studs)
// studs: false if you don't want studs on top (default true)
// tubes: false if you don't want tubes/pins on bottom (default true)
// studsFront: true if you want studs on the front (default false)
// studsBack: true if you want studs on the back (default false)
// studsLeft: true if you want studs on the left (default false)
// studsRight: true if you want studs on the right (default false)
// studsBottom: true if you want studs on then bottom (default false)
// partialStuds:true if you want studs overhanging non-even bricks. (default false)
// centerStuds: false if you don't want studs centered (default true)
// hollow: false if you don't want open bottom w/tubes (default true)
Upgrade this Thing with Thingiverse AppsCustomization
Edit, personalize, or revise this ThingTools and Utilities
Repair, slice, or enhance this Thing
Fancy Bricks OpenSCAD Lego Brick Builder by kresty is licensed under the Creative Commons - Attribution - Non-Commercial license.
What does this mean?
- You must attribute (give credit) to the creator of this Thing.
- Remixing or Changing this Thing is allowed.
- Commercial use is not allowed.
Show Some Love
Say thanks by giving kresty a tip and help them continue to share amazing Things with the Thingiverse community.Tip Designer
We're sure kresty would love to see what you've printed. Please document your print and share a Make with the community.
To post a Make simply visit this Thing again and click I Made One to start uploading your photo. It’s even easier to post a Make via the Thingiverse Mobile app (available via Google Play and Apple App Store).