WORK IN PROGRESS
Welcome to the wonderful world of digital lego building :)
There are two ways to build Lego™ on your pc: with Lego official LDD (Lego Digital Designer) or with third party software. We’ll look into the second way.
LDraw is a complete, open source suite of tools to build digital models. It contains many different applications, designed to model, to create instructions, to authoring parts, etc. Most important, it contains the Part Library, a collections of all Lego parts ever produced. It was authored in an huge effort by different contributors, to whom we give our gratitude :) All applications in LDraw suite “speaks” the LDraw format, so they can all exchange models and data. You can download everything with the All in one installer located here:
http://www.ldraw.org/article/104.html
Beside the “official” part list, there is also an ”unofficial” one, which contains parts that have yet to be reviewed or perfected to be made official. LDraw suggest to only pick from this list on an “as needed” basis, downloading a single part each time. I preferred to dump the whole unofficial library into the official one, which is explicitly discouraged by LDraw :P. You can eventually still download the whole unofficial part and place it in a second folder following this tutorial http://www.holly-wood.it/mlcad/customizing-en.html#scan . The part library folder is something like: C:\Program Files\LDraw
We’ll look into mainly three programs: MLCad for modelling, LDView for viewing and LPub to create instructions. This is a quick, practical tutorial. More precise, detailed tutorials can be found here. I’ll try to fill the gaps of these tutorials, expecially for the practical side.
So, start MLCad and you’ll be greated with this screen:
The area are as follow:
The last part, the Project Part List is a list where all parts you added to your model are shown. One important thing to know is that an LDraw model is a sequential list of command, where each command can be either something like “add this part here” but also other meta commands, like “mark a step here”, or “rotate here during instructions to show the back” or simply comments. Being sequential, it is important to add stuff in the right order (you can of course reorder manually, but it adds work). We’ll see the part list in more detail later.
We’ll now try to recreate this fantastic racing car in MLCad.
First thing to consider is how the building sequence will procede. That is, how will the builder go on to assemble the model? Usually it's from the bottom of the model to up, but for complex model you have to think a little more ahead, as you could create steps that will make the submodel too fragile or straigth impossible to build. In this simple example, we'll do bottom up.
Then i usually think about the center of the model. The center of the model is important to choose beforehand becouse it's a pain to correct later. It will be the center of rotation for the model. Some viewer will calculate model center automatically, but others will show as is so it’s better to keep things clean. For this model, we'll center on the 1×2 red plate in the middle.
So, let's add it! Open the part library and choose “Plate” and then “Plate 1 x 2”. Drag it in the middle of the scene anywhere. Once it's there, we'll center it on the origin of the model. Click the “Position and rotation” button, and set position to 0,0,0.
Now the model is centered, as long as we don't move that part, it will be perfect! But we want it red. So just select the part and click the red square on the color bar. More on colors later. Hooray, we added our first part :)
Let's go on and add the two gray wheel holder. Now, where will we find the part in the library? This is a very important question, deserving his own chapter :)
I mainly use MLCad to port my physical MOCs to digital. In this use case, i often end up with a physical part that i can’t find anywhere in the library. There are some untold rules about sorting and searching the part library, i'll give you a taste.
First, parts are subdivided into main categories, the most importants are:
This subdivision is quite easy. Each part is usually followed by a two or three dimensions definition, like “1 x 2” or “3 x 4 x 5” etc. Slopes are a bit more involved, as the name also includes the degree of the slope, or it says if it’s curved. Each category also contains modified parts. For example, a 1 x 2 plate with the hook, will still be in Plates. Even if a part has a very big appendage, but has a recognizable plate area, it’s still in “Plates”. Here’s a standard 1 x 2 plate and four modified:
The “Others” section contains plenty of stuff :) Everthing that cannot be easily categorized in the other sections. Some big subsection of Others that you should be aware of are Disks, Brackets, Wheels, Tires, Windscreens, etc. Spend some time looking around the library to feel comfortable :) All this sections can be reconfigured at will.
Another important thing to know is that each part ever produced has his own ID. Actually two IDs, a PartID and a DesignID. The PartID is specific of both the part and the color (so same part, different color results in different PartId), while the DesignID is specific only of the part (the mold, you could say). LDraw use the latter (and calls it Part Id or simply id). This is extremely useful becouse if you know the DesignID, you can find it instantly on the part library with a “search by number”. And you can find the precise match, which is not always easy, as many parts are very similar and it’s easy to choose the wrong one. So how do you find the ID? If you know which set the part is from, you can search it on any online database resource. Returning to our wheel holders, i know they’re from the little car in set 7345. So i go to my fav Brickset, and take a quick look at Parts. And here it is:
You can see that it has two codes, 4211504 and 4600. The first one is the PartID, the second one is the DesignID. Armed with that number, we go to MLCad, CTRL-F and Search by Number, we enter 4600 and voila’, the part is selected. Unsurprisingly, part is listed as “Plate 2 x 2 with Wheel Holders” under “Plates”, as per the rules we saw above. But wait a second, there are more things you want to know about the part library.
Take a look at these two parts:
They look identical, don’t they? Look again. Part on the right has a small groove on the bottom, which is probably there to make it easier to remove it from a plate. Oddly enought, they have the same DesignID 3794, and looks like Lego uses both of them (some new sets still have the left design part). So one ID, two parts. Thanks Lego :) For LDraw, the workaround to this situation is having 2 parts, part a and b. If you look in the part library, you’ll find 3794a and 3794b. Almost all tile pieces have groove, so pay attention when you search :)
There are also revisited parts that have a different ID, so you have two mostly identical pieces with completely different ID.
Or parts with different ID between LDraw and Lego.
Or some parts are missing from LDraw altogheter.
It's a jungle out there :)
If you want to know more, here’s a faq for the numbering scheme.
On, now let’s add the two 4600. Drag the part and align it correctly in all the three views. Rotate the “free look” area to make sure they’re placed at the sides of the 1×2 plate. You have noticed that the parts move by discrete steps, about a plate (half stud) in length. This makes aligning parts very easy. It is becouse this option is set:
As long as you build “in vertical” with all parts unrotated, this is fine. As soon as you start to put parts at 90° (such as the wheels of the car), using any SNOT tecnique or enter a technich axle or such, you won’t be able to align part, and you’ll have to switch to a finer grid (there are two of them). More on this later. Now we have to choose the color. And it’s not simple as you’d think.
Ok, colors are a little convolute. Basically, each color has a number in LDraw, and a different number at Lego. Not only that, but color names are different too. There’s a handy page where you can see the mappings:
http://www.ldraw.org/article/547.html#colour_chart
It lists each LDraw color preceded by the corresponding Lego ID and Name. So if you know the color from sites like Brickset, you can look it up there.
There’s a famous pitfall with greys. The two greys (dark and normal) that you find in the toolbar (ldraw codes 7 and 8) are the OLD greys, used up to a decade ago or so. Since then, Lego used two new greys, listed by them as “Medium stone grey” and “Dark stone gray”, and by LDraw as “Light bluish gray” and “Dark bluish gray”. (also, they use both grey and gray??). These are the ones you probably want to use (ldraw codes 71 and 72). Bluish Gray is also known as Bley in the community. Also note that there are colors for rubber stuff (Rubber black for example), transparent (Transparent blue, transparent clear, etc), metallic, glittered, etc. Take some time to look around.
So, these wheel holders are “Medium stone gray” as we can see on bricklink, so we choose “Light bluish grey”, color 71. Now we have completed the first “layer” of parts. It is a good moment to add a “STEP” command. The step command tells LDraw that our first building step is finished. The three parts will end up in step 1, which is fine, even if they’re not connected, as long as we connect them in the following step. Choosing when to instert a STEP separator is up to you and your common sense. I like to group as many parts as possible to minimize step count (and building instructions size), as long as nothing is covered too much to be difficult to understand. You can experiment as you can always go back and change the order of parts and steps. So, add a step like this:
If you added it in the wrong position, no worry. You can drag it up and down with the mouse.
Now we add the 4 x 2 plate. As a standard in LDraw library, the smaller number dimension comes first, so it’s actually a 2 x 4 plate. Drag it in position. Also add “Bracket 1 x 2 - 1 x 4 Type 2” in front of the plate. After that we can add a second STEP. You probably need to rotate these parts when you place them. You can do so with the Rotate around Y axis buttons. Also, you have to color them (you know how to do this).
Now it’s Exercise Time! Go on and place all other pieces, up until the wheels. Place steps as you see fit. When you’re done, compare with my parts and steps here:
We have to use fine positioning when we have to put a SNOT part, when we put technic pin and axle, when we add wheels, connect clips and hinges, etc etc, that is, in any case when we add a part not plate-aligned with the rest.
Now, we can use the tecnique learnt above to know that the wheel rims are part 4624, and it is indeed present in LDraw part library. Drag one on the model, paint it white, rotate as you need and try to align it to the holder. You can’t! You need to set the finest grid to be able to move the part freely. Try it, you can now move it with more precision. There are a few tricks to align a part correcly. One is to switch to wireframe view. You can easily see the rim on the left is unaligned while the one on the right is ok.
Once you’ve placed a single rim, placing the other is easy with a trick. While rims are not plate-aligned with the body of the car, they’re indeed plate aligned with each other! To demonstrate it, take a look at this image:
All rims are aligned so if one of those indicated by an arrow is correctly placed on his holder, then the others are too. (well maybe you need to turn 180°). This is almost always the case with wheels, and symmetric models in general. So how do we use this concept? Simple: switch back to the coarse grid, select the only rim you placed, and press CTRL-D. This will create a duplicate. Now move the new one on one of the other holder. Repeat x3, rotating when necessary. You should end up with something like this:
A similar trick can be pulled to create the tires. You just need to select one rim, transform it in the correct tire, and you’re done. This is becouse parts that are meant to work together always share the same center so they’ll be perfecly aligned. Our tire is part 59895. Select a rim, duplicate it, then double click the new one. A window will appear where you can change the part number (either navigate to it or change it manually):
Voila’, you’ll have a perfecly aligned tire. Just paint it Rubber Black. Now either repeat the second trick or the first one, to create last three wheels.
And we are done! We build the complete model, with steps and all :)
Now, if you save your project, you’ll find a file, such as car.ldr, which contains the model. If you doubleclick it, it should automatically open in LDView. If it doesn’t, open LDView first and open your model from there. LDView has a great renderer and you’ll see your model in all his glory. More importantly, you can navigate the building steps to see intermediate steps. Fiddle with this buttons and see by yourself:
We can use this tools before generating the instructions, to see if there’s something wrong in the building steps we prepared. Most probably there’s some errors, maybe a part that ended up in the wrong step, or a missing step, etc. Go back to MLCad and correct the errors.
Now we are ready to generate the building instructions. This is done with LPub, which is a great software, but is also quite buggy. So if something doesn’t work, it’s not necessarily you to blame :) Also, you most probably want to retouch the generated instructions, to correct this or that imperfections. I do this postprocessing with Gimp, mainly to compress building instructions in as few pages as possible, avoiding big empty portions, and to add a logo.
A good, detailed tutorial for LPub is avaiable here: https://sites.google.com/site/workingwithlpub/
Fire up LPub and open your “car.ldr”. You’ll have this screen.
It already shows the first step. Before we continue, we want to tweak some settings. You can take a look at the settigns menu, but actually the only defaults we want to change are on the “part list” menu. The part list is the box on the top-left corner which shows the parts for the current step. Go on the Part List Setup menu, choose Contents and set Scale to 0,75 instead of 1 (we want it smaller), and also set both part count and part length to 18 or 20. This is the suggested setting on the tutorial linked early, but you can choose as you wish, obviously.
Now, the first step is ok, but each step is in a different page, while we want as much steps as possible on a single page. You can add steps to a page with the “Add next step” command:
After all steps, you can decide to add the “bill of materials” that is the list of all needed parts to build your models. To do this, add a new page at the end with “Append new page” command, then select “Add bill of materials”.
That’s it. Now we can export images with “Export as” command, under File. Choose “Export as png images”.
Et voila’ :) You’ve created your first model with instructions!
Now, the program has generated two pages. For some reason, in LPub the bill of materials can only live in its own page. This is a pity since in our case a single page would be more than enought. Let's reorganize the pages and join them with an external program! So let's go back to the first page, right-click on the third step and choose “add a divider after this step”. The steps are now in two columns. To layout stuff better, reshape the part list of each step so that they're all in columns:
Now generate the PNG again. Open them with your favourite graphic editor (i use the Gimp), merge the content, move things around, add title, logo and whatever you like. You'll end up with a finished product like this:
TBD