Lego-compatible icon kit: Difference between revisions

The educational technology and digital learning wiki
Jump to navigation Jump to search
Line 95: Line 95:
    width=3, length=3, row=-3, height=HALF, scale=DOBLO, block=false);
    width=3, length=3, row=-3, height=HALF, scale=DOBLO, block=false);
</syntaxhighlight>
</syntaxhighlight>
To make sure that they fit, execute both lines together, then comment one and do the other.

Revision as of 19:16, 20 January 2021

Introduction

This page describes a kit to create Lego-compatible icon bricks (mini, Lego, Duplo and Quatro size)


See also:

Procedure

In a nutshell, SVG shapes must be transformed into shapes composed of (very small) lines. The procedure is described in Repraprip Blog (2011) and also in our OpenSCAD beginners tutorial.

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

Export as DXF

To transform Bezier curves to series of straight lines.

  • Select all objects (CTRL-A)
  • Use Extensions -> Modify Path -> Flatten Beziers Select a value of 0.1 or lower.
  • Save as Desktop Cutting Plotter v12 (dxf), using the default options

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.dxf", 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,
		   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
  • Start by importing the shape "as is" and then adjust positions
 icon_brick ("noto-mono-smiling-face-with-sunglasses-segments-2.dxf", 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 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

Possible example:

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

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.