Doblo factory version 1: Difference between revisions

The educational technology and digital learning wiki
Jump to navigation Jump to search
Line 130: Line 130:




==== Text ===
==== Text ====


Is a text with glyph characters (see above).
Is a text with glyph characters (see above).

Revision as of 23:37, 8 April 2010

<pageby nominor="false" comments="false"/>

Introduction

Doblo Factory is the name of a set of OpenScad modules we wrote to generate duplo-compatible structures and bricks. These modules are based on parametric lego duplo, prior work by by Domonoky.

Since OpenScad allows to "union" bricks, it is fairly easy to stack up bricks made from parametrable OpenScad modules in order to create larger structures. Since the doblo factory modules use grid-based positioning and size parameters, they are fairly easy to use for non-programmers. However, you are expected to be familiar with using a formal languages (e.g. HTML or SPSS or simple use of scripting languages). See the example section for some module usage code.

The OpenScad modules and an example design is available on Thingyverse.

See also: Lego Dacta, i.e. an article describing a Lego product line for education.

Usage

The positioning framework

Doblo uses a grid like a chessboard. Origin is in the middle like in most 3D representation languages.

  • Column = left to right (x axis)
  • Row = forward to backward (y axis)
  • up = upwards (z axis)

All blocks, except the doblo block has the origin in the upper left. Since one only uses the doblo block once for the base plate, it has is x,y origin in the middle.

Parameter names used

  • col: the x axis (left-to-right)
  • row: the y axis (forward to backward)
  • up: the z axis (down to up), each block has relative z = 0.. I.e. a block of up=1 would sit on a block of height=1.
  • width: length on the x-axis. Except for the doblo block whose origin is inthe middle, origin is upper left
  • length: length on the y-axis, Except for the doblo block whose origin is in the middle, origin is upper left
  • nibbles_on_off: true = nibbles on top, false = no nibbles

Units

  • Units for columns, rows, with and length: 1 unit = 16mm
  • Units for height: 1 unit = 4.8 mm
  • Units for rotation angles around z-axis: Only 0, 90, 180, 270

Using openscad doblo modules

To create your own more complex custom shapes, there are several modules (functions). All of these use the same position system.

Doblo factory OpenScad module bricks - top
Doblo factory OpenScad module bricks - bottom

doblo brick

Creates a typical duplo-compatible brick. Typical use is to create a Doblo base on which you then can add other structures. You also can pile up (union) these bricks, but that may lead to a waste of processing time and plastic. Doblo bricks are just like Duplo bricks, however you can make the nibbles on top optional.

Syntax
doblo (col, row, up, width,length,height,nibbles_on_off)

doblo light

Same as above, but with a grid instead of nibbles undederneath. Faster to generate and to print (probably).

Syntax
doblo_light (col, row, up, width,length,height,nibbles_on_off)

Merge STL files

Positions an stl file, you may have to find out by trial and error what z offset to use. Tip: embed the STL into a doblo or a block.

Syntax
merge_stl (file, col, row, stl_z_offset_mm)

Block

Creates a building block for larger structures with x,y,z positioning. A block does not have nibbles underneath and may or may not have nibbles on top. Also could be used to print a base plate.

Syntax
block (col, row, up, width,length,height,nibbles_on_off)

Nibbles

To insert nibbles on some spots of a nibble-less block or an imported STL. For use in larger structures.

Syntax
nibbles (col, row, up, width, length)

Bottom nibbles

To insert underneath an imported STL. Not very usefull I think, I'd rather stick a doblo block to the feet of an imported object.

Syntax
bottom_nibbles (col, row, up, width, length, N_height)

Support triangles

Support triangles are used in larger structures to support a roof.

  • Thickness = 1 doblo width, e.g. = PART_WIDTH.
  • Sometimes you may want rational numbers. E.g. 1.5
  • Height/length proportion is 4.8/4 (i.e. typical Lego proportions).
  • Only use angle arg of 0,90,180,270 !!

WARNING: You may want to have these bricks overlap a bit, e.g. if 2 corners are just touching, the model will be not be "simple" and can't be exported as STL. In other words, make them a bit higher and position a bit off (embed into the block that you will put on the back and embed the back in a side block). See the stronghold example included.

Syntax
support (col,row,up,height,rotation_angle,thickness)

ramp

ramp is the opposite of the support triangle, but with a flatter angle. Can be used to anchor a high and slim block or also to build a real ramp (then you might place 2-4 next to each other.

  • Height/length proportion is 4.8/16 (i.e. typical Lego proportions)

Syntax:

ramp (col,row,up,height,rotation_angle)

Notice: I'll have to add width to this one

Cylinder

cylinder is like a block, but round.

  • Can have nibbles on top.

Syntax:

cyl_block (col, row, up, bottom_r, top_r, height, nibbles_on_off)

Glyph

Is a letter, a number or a special character. This module is based on OpenSCAD Bitmap Fonts Module

Syntax:

glyph (col, row, up, height_mm, char)


Text

Is a text with glyph characters (see above).

Syntax:

text (col, row, up, height_mm, chars, count)

count is the number of letters chars is an array.

Example

text (1, 6, 2, 4, ["T","H","i","N","G","Y"], 6);

Simple mashup blocks

module merge_brick ()

Syntax
merge_brick ()

Allows to create a mashup brick with a duplo-compatible block at the bottom, a "presentation brick" in between and an imported .STL file on top. Not very powerful, but a quick way to create new kinds of Duplo persona for example.

Usage: Edit the first section of the merge_brick module and change the parameters below.

// BASE PLATE PARAMETERS

// 1 = standard doblo with (i.e. 16mm on the x axis)
    doblo_width = 2;           	 

// 1 =  standard 4x4 doblo length (i.e. 16mm on the y axis)
    doblo_length= 2;          

// 1 =   minimal doblo height (i.e. 4.8 mm on the z axis), 4 = typical brick
    doblo_height = 2;          

// true or false - not needed if presentation block is same size
    doblo_nibbles = false;      
    
// STL file PARAMETERS
    
// filename (a string), middle of object should be x,y ~ 0 !!
    stl_file = "duck.stl";     
    
// units are mm - how much move the STL up/down with respect to the presentation block - TRY !
// if the STL sits on z=0 then about half height. Just try until it's ok ;)
    stl_lift = 0;            
                             
// Positioning - moves STL and support block right and forward/backward by columns and rows. 
// pos in N doblo_width/2.  0 = left border of base plate
    STL_col = 0;             
// pos in N doblo_length/2. 0 = upper border of base plate
    STL_row = 0;             
    
// Size of the block underneath the STL
// height of the presentation block in terms of doblo_height, can be 0
    block_height = 3;        
// width of presentation block in N doblo_width, e.g. 2 means 2 nibbles
    block_width = 2;         
// length of presentation block in N doblo_ width, e.g. 2 means 2 nibbles
    block_length = 2;

Parameters

Parameters are made for Duplo blocks. To get Lego (not yet tested!) divide by half. Probably it won't work. You also should change the nibble code ... (TO DO)

// doblo size
PART_WIDTH   = 16;
PART_HEIGHT  = 4.8 ;

// nibble size definitions
NO =  PART_WIDTH / 2; //nibbleoffset
NBO = PART_WIDTH;     // nibble bottom offset
NH  = 4.5;            // height of normal nibble

// walls - might be a bit fatter. Depends also on your print settings
DOBLOWALL = 1.55;	
INSETS   = 1.35; //little inset walls to make it stick

// Sizes of a standard 2x2 square brick, normal height
// Not used, but are pratical in your custom modules
DOBLOWIDTH  = PART_WIDTH * 2;
DOBLOHEIGHT = PART_HEIGHT * 4;

Examples

Doblo structure - A stronghold

The following structure was my first creation and it did have some design flaws. But it did print.

Strong-hold in progress

But it did print:

Stronghold printed

See the happy Duplo persons !

Happy duplo persona enjoying their new home
Module name
stronghold ()

Below is a revised design which I didn't print yet. It's included in the doblo-factory-1.scad file.

Stronghold - version 2 as seen in Netfab

The code is fairly complex, because we needed some support triangles. These should be replaced by pillars some day ...

module stronghold ()
{
    union()
	{
	    //    Base plate, for faster printing replace by block
	    //    (col, row, up, width,length,height,nibbles_on_off) 
	    // doblo (-5,  -5,   0,  10,   10,    1,     false);
	    doblo_light (-6,  -6,   0,  12,   12,    1,     false);

	    //      (col, row, up, width, length)
	    nibbles (3,   -6,   1,  3,     3      );
	    nibbles (1,   3,   1,  5,     3      );
	    nibbles (-6,  3,   1,  3,     3      );
            //    (col, row, up, width,length,height,nibbles_on_off) - blocks
            //    (col, row, up, height,degrees) - ramps    
	    // back

	    ramp  (-5,  -5,   1,  2,   0);
	    block (-5,  -5,   1,  1,   1,    12,     false);	    

	    ramp  (-3,  -5,   1,  2,   0);
	    ramp  (-3,  -5,   1,  2,   180);
	    block (-3,  -5,   1,  1,   1,    12,     false);	    

	    ramp  (-1,  -5,   1,  2,   0);
	    ramp  (-1,  -5,   1,  2,   180);
	    block (-1,  -5,   1,  1,   1,    12,     false);	    

	    ramp  (1,  -5,   1,  2,   180);
	    block (1,  -5,   1,  1,   1,    12,     false);	    
	    // left
	    block (-5,  -3,   1,  1,   1,    22,     false);
	    block (-5,  -1,   1,  1,   1,    22,     false);
	    // front
	    ramp  (-5,  1,   1,  2,   0);
	    block (-5,  1,   1,  1,   1,    12,     false);	    

	    ramp  (-3,  1,   1,  2,   0);
	    ramp  (-3,  1,   1,  2,   180);
	    block (-3,  1,   1,  1,   1,    12,     false);	    

	    ramp  (-1,  1,   1,  2,   0);
	    ramp  (-1,  1,   1,  2,   180);
	    block (-1,  1,   1,  1,   1,    12,     false);	    

	    ramp  (1,  1,   1,  2,   180);
	    block (1,  1,   1,  1,   1,    12,     false);	    
	    // right
	    // block (0,  -4,   1,  1,   3,    8,     false);
	    // big arc
            //      (col, row, up, height,degrees) 
	    support (-5, -5,   9,   14,   270, 1) ;
	    support (-4.1,  -5,  21,  2.2,  0, 7);
	    support (-3.9,  -5,  21,  2.2,   180, 7);

	    support (-3, -5,   9,   14,   270, 1) ;
	    support (-2.1,  -5,  21,  2.2,  0, 7);
	    support (-1.9,  -5,  21,  2.2,   180, 7);

	    support (-1, -5,   9,   14,   270, 1) ;
	    support (-0.1,  -5,  21,  2.2,  0, 7);
	    support (0.1,  -5,  21,  2.2,   180, 7);

	    support (1,  -5,   9,   14,   270, 1) ;
	    
	    support (-5, 1,   9,   14,   90, 1) ;

	    support (-3, 1,   9,   14,   90, 1) ;

	    support (-1, 1,   9,   14,   90, 1) ;

	    support (1,  1,   9,   14,   90, 1) ;
	    
	    // Roof
            //    (col, row, up, width,length,height,nibbles_on_off) 
	    block   (-5,  -5,   23,  7,   7,    1,     false);
	    nibbles (-3,  -3,   24,  3,   3);

	    block (-5,  -5,   24,  7,   1,    4,     false);
	    nibbles (-4,  -5,   28,  5,   1);

	    block (-5,  1,   24,  7,   1,    4,     false);
	    nibbles (-5,  -4,   28,  1,   5);

	    block (-5,  -4,   24,  1,   5,    4,     false);
	    nibbles (-4,  1,   28,  5,   1);

	    block (1,  -4,   24,  1,   5,    4,     false);
	    nibbles (1,  -4,   28,  1,   5);
	    //          (col, row, up, bottom_r, top_r, height, nibbles_on_off) 
	    cyl_block   (-6,   -6,  1,  2,       2,     32,   true) ;
	    cyl_block   (1,   -6,  1,  2,       2,     32,   true) ;
	    cyl_block   (-6,   1,  1,  2,       2,     32,   true) ;
	    cyl_block   (1,   1,  1,  2,       2,     32,   true) ;
	}
}

To use this "as is", just uncomment the following line in the doblo-factory.scad file:

// stronghold ();

Some mashups

In the following picture you can see two kinds of mashups:

  • Larger STL models put on top of bricks. I actually did these with Meshlab before I learnt how to use OpenScad.
  • Doblo bricks with webdings on top. Produced with either OpenScad alone or with Netfabb Studio. The basic version of Netfabb does have a 3D text. The pro version can directly export a mashup. Users of Netfabb Studio basic should also use either OpenScad or Meshlab for merging.
Some Doblo bricks (Duplo compatible). Various Skeinforge settings, some bad

Printing

Some printing hints for the RapMan (skeinforge settings)

You may want to read the Skeinforge for RapMan to understand what mean here.

  • Try small objects first, e.g. a 3x3x3 doblo brick
Fill
  • Fill of 0.1 should be ok (I tested with 0.05)
PLA
  • Use PLA on large objects to prevent warping
  • Temperature: 210 (all) and Fan on
  • Raft: One interface layer
  • Flow rate: At least 380 (for horizontal structures)
Other
  • Solid Surface Thickness for both ABS and PLA: 4
ABS

Since skeinforge does not really produce what I want, I'd suggest to produce sort of a normal "fat" raft code, then edit the g-code file and double up M108 and Fxxx values. Make it twice as fast, else it takes hours to get just the raft printed ....

Printing pauses and recovery from print abortion.

A larger structure like the stronghold takes over 24 hours to print. If you use PLA, it's ok to interrupt (hit the ESC key) while you sleep or do other stuff. I don't know about ABS.

However, if you encounter a card read error or a filament problem after 20 hours of printing, frustration can be high ! In the g-code article, we described how we managed to recover. It's not so easy, but certainly less painful than to restart.

Educational use

(will be written later ....)

  • Creation of 3D duplo-compatible "play" boards for various purposes from Kindergarten to Master level
  • Introduction to 3D graphics and design (learn about positions) and simple use of OpenSCAD
  • "End-user 3D programming" environment (e.g. students could add other primitives)

Bugs, to do

Bugs
  • cyl_block nibbles can't handle top_r < 2 and rational numbers
Needed
  • a pillar with both supports for bottom and top (i.e. 2x4 directions)
Improvements
  • replace support modules by triangle_forward, triangle_right, etc.
  • Parametrize all numbers
  • Make it also Lego compatible
Adjustments
  • make the nibbles underneath a bit fatter maybe
  • Figure out the best skeinforge settings for ABS and PLA

Links

OpenScad
End-user programming / microworlds