LEGO™ rocks, sharing knowlege rocks. Sharing Lego models kicks ass. To do so you can either send you LEGO™ constructions by mail or (better) use a CAD program to model your ideas digitally and upload it. I had a look around for open source tools specialized on modeling plastic toy bricks and found LeoCAD.
To be perfectly honest – this tool has still its weaknesses and is not very stable but it’s enough to get the job done. I first tried to install a compiled version on Ubuntu 10.4 but ended up compiling it myself. There is a very helpful guide for this. Unfortunately not all versions run without problems so currently I can recommend to use version 0.75.1 – other versions e.g. were not able to load saved files (quite a painful experience when you spent some time in creating a model). As mentioned in the compiling guide you should check if you have everything needed (e.g. OpenGL and GTK) installed before compiling:
$ sudo apt-get install libgtk2.0-dev libgl1-mesa-dev
After that you can download the source using subversion and compile it:
$ mkdir /tmp/leo_tmp $ cd /tmp/leo_tmp $ svn co http://svn.gerf.org/leocad/tags/leocad-0.75.1 leocad $ cd leocad/ $ mkdir /opt/leocad-0.75.1 $ mv bin/ /opt/leocad-0.75.1/
LeoCAD needs libraries of pieces (e.g. the bricks). Download and unzip the recommended library the following way:
$ cd /opt/leocad-0.75.1 $ mkdir pieces $ cd pieces/ $ wget http://leocad.googlecode.com/files/pieces-3506.zip $ unzip pieces-3506.zip $ ls -1 pieces-3506.zip pieces.bin pieces.idx sysfont.txf textures.bin textures.idx
Now we are ready to launch LeoCAD. You have to tell it where the pieces libraries are.
$ export LEOCAD_LIB=/opt/leocad-0.75.1/pieces/ ; /opt/leocad-0.75.1/bin/leocad
(If you use it more often you might want to create and alias for this.) LeoCAD should be now up and running – waiting for you input. I recommend to have a look at the basic tutorial to get a feeling how to work with it.