Lego-compatible icon kit: Difference between revisions

The educational technology and digital learning wiki
Jump to navigation Jump to search
mNo edit summary
 
(26 intermediate revisions by the same user not shown)
Line 7: Line 7:
* [[Doblo factory]]
* [[Doblo factory]]


== Preparation of the dxf with InkScape ==
== Procedure ==
 
Newer versions of OpenScad can directly extrude from SVG. The procedure is also described in our [[OpenScad_beginners_tutorial#Import_and_extrude_2D_graphics_from_SVG|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 [http://repraprip.blogspot.com/2011/05/inkscape-to-openscad-dxf-tutorial.html Repraprip Blog] (2011)
 
We shall explain the procedure using [https://iconify.design/icon-sets/emojione-monotone/smiling-face-with-sunglasses.html temojione-monotone:smiling-face-with-sunglasses] ([https://creativecommons.org/licenses/by-sa/4.0/ CC BY-SA 4.0])
 
=== Preparation of the dxf with InkScape ===
 
Open the [https://iconify.design/icon-sets/emojione-monotone/smiling-face-with-sunglasses.html 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,
# 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).
# 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)
# Set the document size to this size plus a 1mm margin (this way re-usability will be better):
# Group the elements,  
# Group the elements,  
# then position the group in the center of the document
# 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)
[[image:icon-kit-1.svg|thumb|600px|none|Size and positioning in InkScape]]
=== Import to OpenScad ===
To import, extrude and position an icon, use the following procedure call, shown with its default values.
<syntaxhighlight lang="javascript">
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)
</syntaxhighlight>
[[File:A_icon_brick-emoji-sunglasses.png|200px|right|thumb|Smiling Face with Sunglasses ([https://iconify.design/icon-sets/emojione-monotone/smiling-face-with-sunglasses.html emojione-monotone:smiling-face-with-sunglasses])]]
* Choose the '''size and scale of Lego compatible,''' e.g., for a 3x3 Duplo block:
<syntaxhighlight lang="javascript">
width = 3
height =3
scale = DOBLO
</syntaxhighlight>
* 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.
<syntaxhighlight lang="javascript">
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);
</syntaxhighlight>
* 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)
<syntaxhighlight lang="javascript">
x_off = 10  // total Lego size is 48mm, emoji is scaled to 30mm
y_off =10
d_scale = 3
</syntaxhighlight>
* Add and position text. You can add two lines of text. ''text2'' refers to the second line.
Possible examples:
<syntaxhighlight lang="javascript">
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);
</syntaxhighlight>
<syntaxhighlight lang="javascript">
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);
</syntaxhighlight>
=== Dealing with double extruders ===
[[File:A_icon_brick-emoji-sunglasses-2.png|200px|right|thumb|Smiling Face with Sunglasses ([https://iconify.design/icon-sets/emojione-monotone/smiling-face-with-sunglasses.html emojione-monotone:smiling-face-with-sunglasses])]]
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 <code>block=false</code>. Example code for two different objects
<syntaxhighlight lang="javascript">
doblo (width=3, length=3, scale=DOBLO, height=HALF, nibbles_on_off=false);
</syntaxhighlight>
On top:
<syntaxhighlight lang="javascript">
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);
</syntaxhighlight>
To make sure that they fit, execute both lines together, then comment one and do the other.
'''Cura settings'''
[[image:cura-2-no-drop.png|thumb|400px|none|Cura settings - Untick Automatically drop models to the build plane]]
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.
[[image:cura-2-double-extruder.png|thumb|600px|none|Slicer arrangement and settings - Verification]]
== Multiple icons ==
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 of icon only
<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>
<gallery mode="packed">
file:A_icon_brick-faclab-2.png|Model with "doblo" unquoted
file:A_icon_brick-faclab-2.jpg|Model printed with 0.4 layers.
</gallery>
== 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
== Using emoji ==
The simplest way is to download emoji from [https://iconify.design/icon-sets/ iconify.design]. Emoji collections of particular interest are
* [https://iconify.design/icon-sets/emojione-monotone/ Emoji One (Monotone)] (only 1403 elements)
* [https://iconify.design/icon-sets/twemoji/ Twitter Emoji] (not all are suitable for monochrome printing, but they are simpler than Google icons for example)
* [https://iconify.design/icon-sets/openmoji/ 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£:
* [https://emojipedia.org/ Emojipedia]
To search by fine grained official category, browse through the long official catalogue page:
* [https://www.unicode.org/emoji/charts-13.1/emoji-list.html 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 <code>Modify Path -> Flatten Beziers</code> extension (value = 0.05 or lower).

Latest revision as of 16:47, 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.

  1. Set the right size, e.g. 40 x 40 mm of the object: CTRL-A, setting the lock,
  2. then use the W or H on top (whatever is bigger).
  3. Set the document size to this size plus a 1mm margin (this way re-usability will be better):
  4. Group the elements,
  5. then position the group in the center of the document
  6. (Optional) Clean the document: File -> Clean document
  7. (Optional) Set strokes and fills, Make sure that "black" is black and not undefined.
  8. Ungroup and unlayer everything (verify this, it is maybe not necessary anymore)
Size and positioning in InkScape

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)
Smiling Face with Sunglasses (emojione-monotone:smiling-face-with-sunglasses)
  • 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

Smiling Face with Sunglasses (emojione-monotone:smiling-face-with-sunglasses)

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

Cura settings - Untick Automatically drop models to the build plane

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

  1. Load blocks and icons
  2. Select top view (little icon down left)
  3. Move the icons in place
  4. 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
  5. Enable the second extruder on top menu bar
  6. Select Lego compatible block(s) and assign to left extruder (little vertical bar to the left)
  7. Select icon(s) and assign to right extruder
  8. Set to isometric view and check everything.
Slicer arrangement and settings - Verification

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

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

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:

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).