Lego-compatible icon kit
This page describes a kit to create Lego-compatible icon bricks (mini, Lego, Duplo and Quatro size)
Newer versions of OpenScad can directly extrude from SVG. The procedure is also described in our OpenSCAD beginners tutorial.
The procedure for older versions was more complicated. In a nutshell, you can ignore advice that SVG shapes must be transformed into shapes composed of (very small) lines. The procedure was described in Repraprip Blog (2011)
We shall explain the procedure using temojione-monotone:smiling-face-with-sunglasses (CC BY-SA 4.0)
2.1 Preparation of the dxf with InkScape
Open the SVG in Inkscape or any other SVG editor that allows exporting to the DXF format.
- Set the right size, e.g. 40 x 40 mm of the object: CTRL-A, setting the lock,
- then use the W or H on top (whatever is bigger).
- Set the document size to this size plus a 1mm margin (this way re-usability will be better):
- Group the elements,
- then position the group in the center of the document
- (Optional) Clean the document: File -> Clean document
- (Optional) Set strokes and fills, Make sure that "black" is black and not undefined.
- Ungroup and unlayer everything (verify this, it is maybe not necessary anymore)
2.2 Import to OpenScad
To import, extrude and position an icon, use the following procedure call, shown with its default values.
module icon_brick ("my_icon.svg", width=4, length=4, height=HALF, x_off=5, y_off=1, out=false, d_scale=1, d_height=4, text="", font="Comic Sans MS", font="Barlow:style=Bold", text_size=6, text_x=1.5, text_y=1, text2="", font2="Barlow:style=Bold", text2_size=6, text2_x=1.5, text2_y=1, scale=LUGO)
- Choose the size and scale of Lego compatible, e.g., for a 3x3 Duplo block:
width = 3 height =3 scale = DOBLO
- Select height. Minimum height is HALF. Default is FULL. E.g. the smallest height do:
- Import the shape using default parameters and then adjust positions, fonts, scales in a next step. Positioning and scaling may require a few (quick) attempts.
icon_brick ("noto-mono-smiling-face-with-sunglasses-segments-2.svg", x_off=0, y_off=0, out=true, d_scale=1, d_height=2, text="COOL", text_x=13, text_size=7, width=3, length=3, scale=DOBLO);
- Adjust parameters positioning and size'Bold text' of the icon. x_poff = offset in X direction in mm, y_off = offset in y direction in mm, d_scale = scale multiplier)
x_off = 10 // total Lego size is 48mm, emoji is scaled to 30mm y_off =10 d_scale = 3
- Add and position text. You can add two lines of text. text2 refers to the second line.
icon_brick ("noto-mono-smiling-face-with-sunglasses-segments-2.dxf", x_off=5, y_off=11, out=true, d_scale=3, d_height=2, text="COOL", text_x=13, text_size=7, width=3, lengtemojione-monotone:smiling-face-with-sunglassesh=3, scale=DOBLO);
icon_brick("smiling-face-with-heart-eyes.svg", x_off=12, y_off=12, width=2,length=2, out=true, d_scale=0.6, d_height=2, text="faclab", font="Electronics PERSONAL USE:style=Bold", text_x=3, text_y=2, text_size=10, text2="i", font2="Electronics PERSONAL USE:style=Bold", text2_x=2.5, text2_y=16, text2_size=15, scale=DOBLO, block=false);
2.3 Dealing with double extruders
Some slicers require two different STL objects to work with two extruders. In that case produce a flat Lego-compatible block, the produce the extruded icon
block=false. Example code for two different objects
doblo (width=3, length=3, scale=DOBLO, height=HALF, nibbles_on_off=false);
icon_brick ("noto-mono-smiling-face-with-sunglasses-segments-2.dxf", x_off=5, y_off=11, out=true, d_scale=3, d_height=2, text="COOL", text_x=13, text_size=7, width=3, length=3, row=-3, height=HALF, scale=DOBLO, block=false);
To make sure that they fit, execute both lines together, then comment one and do the other.
We did not manage to explain to Cura that it should drop models in the center and top of each other
Cura procedure for a double extruder
- Load blocks and icons
- Select top view (little icon down left)
- Move the icons in place
- Set the Z height for each. We recommend entering the value, e.g. 9.6 for a full LEGO compatible or a HALF DUPLO compatible. See doblo factory for other height values
- Enable the second extruder on top menu bar
- Select Lego compatible block(s) and assign to left extruder (little vertical bar to the left)
- Select icon(s) and assign to right extruder
- Set to isometric view and check everything.
3 Multiple icons
You could combine multiple icons into a single SVG file, but the easier way is just to call several ones, using the
block=false parameter. Below is an example for a dual extruder.
Example of icon only
// three icons icon_brick("math-compass.svg", x_off=3, y_off=12, width=2,length=2, out=true, d_scale=0.6, d_height=2, text="faclab", font="Electronics PERSONAL USE:style=Bold", text_x=3, text_y=2, text_size=10, scale=DOBLO, block=false); icon_brick("light-bulb.svg", x_off=32, y_off=12, width=2,length=2, out=true, d_scale=1.1, d_height=2, scale=DOBLO, block=false); icon_brick("noun_3d-printer_170216.svg", x_off=9, y_off=17, width=2,length=2, out=true, d_scale=1.1, d_height=2, scale=DOBLO, block=false); // doblo (width=3, length=3, row=-3, scale=DOBLO, height=HALF, nibbles_on_off=false); // the block
- A icon brick-faclab-2.jpg
Model printed with 0.4 layers.
4 3D printing parameters
LEGO and DUPLO compatibles are always difficult to print. There are two challenges:
- Making them fit real LEGO (TM) blocks
- Printing the "roof"
Make them fit can only be achieved by tweeking both Doblofactory and slicer parameters. This may take 3-10 prints, depending on your skills and luck.
You can print these in any way you like, but we suggest using somewhat "fatter" layers and no support in order to be productive.
Recommended printer configuration and slider settings for Duplo compatibles, optimizing production speed while keeping some quality.
- A 0.7 or 0.8 nozzle, but a 0.35-0.4 can also do
- 0.35 layers
- layer width will depend on your nozzle (0.7 for a 0.7 nozzle can do but you can less)
- no support
- no brim (unless your printer has a bad bed, but I'd rather use some glue)
- Medium speed
- Slow (!) speed for the first layer, e.g. 10 mm/s
- A skirt with two lines (to make sure that plastic extrudes OK), not a brim that sticks to the block (!)
- No or little retraction
- Infill overlap percentage: 50% (this is crucial or the roof will fall down)
- temperature for PLA: 210
- Fan = low (at least for printing the roof, you can turn it on before and after). The roof will be bumpy and if it's cold, the nozzle may get stuck.
Best results can be achieved with a second nozzle that prints layers more narrowly. Unfortunately the Cura slicer does not allow to work with variable nozzle width, else we would suggest to print the blocks with 0.56 layers with a 0.7 nozzle (the 80% of the width recommended maximum)
- layer width = 0.35 for a 0.35 nozzle
5 Using emoji
The simplest way is to download emoji from iconify.design. Emoji collections of particular interest are
- Emoji One (Monotone) (only 1403 elements)
- Twitter Emoji (not all are suitable for monochrome printing, but they are simpler than Google icons for example)
- OpenMoji drawings use a lot of strokes (whereas twitter does not). Some more complex icons can be used by setting the fill to nil and fattening the strokes.
To search for emoji by keywords and descriptors£:
To search by fine grained official category, browse through the long official catalogue page:
- Emoji List, v13.1 (latest version, as of Jan 2021, this will change)
If you prefer printing strokes, make sure to remove the fill, set the stroke and then break the path somewhere. Also make sure that the SVG does not contain any hidden invisible elements.
You also may have to add extra nodes to large Bezier curves, or just transform the line into a series of very short lines with the
Modify Path -> Flatten Beziers extension (value = 0.05 or lower).