Lego-compatible icon kit: Difference between revisions
m (→Using emoji) |
m (→Multiple icons) |
||
Line 117: | Line 117: | ||
You could combine multiple icons into a single SVG file, but the easier way is just to call several ones, using the <code>block=false </code> parameter. Below is an example for a dual extruder. | You could combine multiple icons into a single SVG file, but the easier way is just to call several ones, using the <code>block=false </code> parameter. Below is an example for a dual extruder. | ||
Example | Example of icon only | ||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
// 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 | |||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 16:55, 22 January 2021
Introduction
This page describes a kit to create Lego-compatible icon bricks (mini, Lego, Duplo and Quatro size)
See also:
Procedure
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)
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)
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:
height=HALF
- 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.
Possible examples:
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);
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);
On top:
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.
Cura settings
- Enable the second extruder on top menu bar
- Select Lego compatible block and assign to left extruder (little vertical bar to the left)
- Select icon and assign to right extruder
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
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).