ArticleslgStudy

computer science

LDraw

LDraw is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand LDraw rather than just read about it. In short: LDraw is a system of freeware tools and a 3D graphics file format standard for modeling Lego creations. History The LDraw file format and original program were written by James Jessiman in 1995, although the file format has since evolved and extended.

LDraw — main illustration
LDraw — illustration

Key takeaways

  • LDraw belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect LDraw to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of LDraw from memory before moving on to harder problems.

Reference excerpt

LDraw is a system of freeware tools and a 3D graphics file format standard for modeling Lego creations.

History The LDraw file format and original program were written by James Jessiman in 1995, although the file format has since evolved and extended. He also modeled many of the original parts in the parts library, which is under continuous maintenance and extension by the LDraw community. As of March 2026 the library contains 16547 unique shapes or patterned parts, excluding shortcuts. Following Jessiman's death in 1997, a variety of programs have been written that use the LDraw parts library, and file format. LDraw models are frequently rendered in POV-Ray or Blender, free 3D ray tracers.

LDraw.org In 2004, LDraw.org organization has been established, which main task is set to further develop LDraw file format and extend LDraw parts library. Organization is controlled by members of LDraw.org Steering Committee (SteerCo for short), elected by LDraw Organization Members. Core members of LDraw.org are in close ties with James Jessiman's family, which is the owner of the LDraw™ registered trademark. The LDraw.org Standards Committee (LSB for short) helms the development of the LDraw file format specifications.

James Jessiman Memorial Award

Since 2001, LDraw.org project org's awards notable contributors with the James Jessiman Memorial Award. Recipient is selected by LDraw.org Steering Committee, and approved after a consultation with Jessiman's family.

Recipients 2001 – Steve Bliss 2002 – not awarded 2003 – Jacob Sparre Andersen 2004 – Lars C. Hassing 2005 – Michael Lachmann - creator of MLCAD 2006 – Orion Pobursky 2007 – Kevin Clague 2008 – Philippe Hurbain 2009 – Tim Courtney 2010 – not awarded 2011 – Travis Cobbs 2012 – Steffen Lohse 2013 – Magnus Forsberg 2014 – Sergio Reano 2015 – Roland Melkert - author of LDCad 2016 – Nils Schmidt 2017 – Chris Dee 2018 – Michael 'Mike' Heidemann 2019 – Gerald Lasser 2020 – Lasse Deleuran 2021 – Leonardo Zide, software engineer at Treyarch, author of LeoCAD (an open-source program for creating virtual Lego models with LDraw). 2022 – Takeshi Takahashi 2023 – Massimo Maso 2024 – Evert-Jan Boer 2025 – Rolf Osterthun

File format

LDraw file format describes "part" (representation of Lego brick) as a set of geometric primitives ("p") in a form of polygonal triangulated mesh. LDraw "models" consists of LDraw "parts", same way as Lego models consists of Lego bricks. LDraw file format is plain text file format, and uses comma-separated syntax definition of values.

Units

LDU (LDraw Units) — is a base distance unit used in the LDraw format, equals to 1/20 of pin step (distance between centers of 2 closest pins on plate), which in turn almost equals to 0.4 millimetre.

Some editors (like, LeoCAD) displaying dimensions and coordinates using only LDU. For measuring and converting sizes from LDU to other units and vice versa, LDraw users created few parts in a form of ruler, that could be used directly in LDraw editors during visual modeling, that especially useful for scale model making.

Scale LDraw, the same as Lego, uses 1:42½ (Lego minifigure scale) as a base for scaling real world objects for scale modeling. The precise scale may vary between 1:40 and 1:43.

Specification The LDraw format can divide a model into steps so that the building instructions can be incorporated into the design, and also allows for steps that rotate the camera and even move parts around in an elementary fashion. It also allows for models to be incorporated in the construction of larger models to make design easier. This also makes the file format space efficient: instead of specifying the polygons of every single stud of a specific brick for example, a shared stud file is included multiple times with transformation applied. Parts, models, sub-models and polygons are all treated the same and are not specific to Lego models (only the parts library is). The format could be used to store any type of 3D model. Some have created bricks of other building systems for use with LDraw. The following main three filename extensions are used by LDraw:

files implementing a part, subpart or primitive use .dat a Lego model consisting of 1 or more bricks use .ldr multiple .ldr files can be aggregated into files of type .mpd The file format uses plain text data, and uses the charset UTF-8 without BOM.

Example File: 3003.dat, the implementation of a 2 x 2 brick

The above code defines the basic 2×2 brick. It consists of a five-sided box (box5.dat, outside) and an inverted five-sided box (inside), the connection between those two, consisting of four quads (the four lines starting with 4), the four studs on top of it (stud.dat) and the long hollow stud in the inside (stud4.dat). All lines in an LDraw file are either empty or start with a command number, where 0 means no command (though over time, some lines starting with 0 followed by specific text in capitals also got a meaning as meta commands). The command 1 for example includes a subfile. It specifies the file's path and a transformation matrix that should be applied to it, as well as its color (where 16 means "use the color that was used when including the current file"). Command 4 specifies a four-sided polygon. There are also commands that define 2D lines. Such lines give the parts a clear contour even in non-shaded orthographic renderings.

Example File: pyramid.ldr, a Lego model of a pyramid The following code specifies a simple pyramid model with three layers made of 2 x 4 bricks (brick # 3001) with changing color and a 2 x 2 brick on top.

Software

Editors BlockCAD BrickSmith LDCad Lego Digital Designer LeoCAD MLCAD

Tools LDView LPub3D

Other examples

See also List of Lego computer-aided design programs Lego Digital Designer

References

Bibliography Courtney, Tim; Bliss, Steve; Herrera, Ahui (2003). Virtual LEGO: The Official LDraw.Org guide to LDraw Tools for Windows. San Francisco: No Starch Press. ISBN 978-1-886411-94-4. Clague, Kevin (2002). LEGO Software Power Tools: including LDraw, MLCad, and LPub. Rockland, Mass: Syngress. ISBN 978-1-931836-76-0.

External links

Official website BrickHub, LDraw-based build library

Illustrations

LDraw illustration
LDraw illustration
LDraw: Lego brick (real) dimensions
Lego brick (real) dimensions
LDraw: Measuring LDraw parts size in LeoCAD with "ruler" part (ruler tick: 1 mm)
Measuring LDraw parts size in LeoCAD with "ruler" part (ruler tick: 1 mm)
LDraw illustration

Worked examples

Example 1 — a first encounter with LDraw

Start with the simplest possible case. Write down what LDraw claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to LDraw before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about LDraw ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of LDraw

In research
LDraw appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses LDraw in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
LDraw is common in secondary-school and first-year university syllabi. It links to neighbouring topics 3D graphics software, Lego, so understanding it makes those chapters shorter.
In everyday life
Look for LDraw outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “LDraw” →

How to study LDraw in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what LDraw means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain LDraw out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is LDraw in simple terms?

LDraw is a system of freeware tools and a 3D graphics file format standard for modeling Lego creations. History The LDraw file format and original program were written by James Jessiman in 1995, although the file format has since evolved and extended.

Why does LDraw matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study LDraw?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on LDraw.

Tags

  • 3D graphics software
  • Lego

Keep exploring