LDraw

from Wikipedia, the free encyclopedia
View of an LDraw model

LDraw is a system of tools and file formats to create three-dimensional Lego building blocks and models on the computer .

The file format was developed by James Jessiman. With him he created many of the first original 3D files of Lego blocks and models. After his death in 1997, fans on the Internet took over the further development.

Various programs have been developed that are based on the file format. This includes programs for editing / processing blocks and models, but also for cataloging and sorting blocks, or those for creating pictures or building instructions.

There are tools for exporting scenes to POV-Ray and Blender .

The file format is kept quite simple, it is text-based and line-oriented. The files are encoded in the UTF-8 character set without BOM .

Files that follow the LDraw standard have the following file extensions:

  • .dat are Lego building blocks
  • .ldr are Lego models made up of building blocks
  • .mpdare summaries of several .ldrfiles into one

Example: 2x2 Lego brick

The following example file implements the standard 2x2 Lego brick (part number 3003):

0 Brick  2 x  2
0 Name: 3003.dat
0 Author: James Jessiman
0 !LDRAW_ORG Part UPDATE 2002-03
0 !LICENSE Redistributable under CCAL version 2.0 : see CAreadme.txt

0 BFC CERTIFY CCW

0 !HISTORY 2001-10-26 [PTadmin] Official Update 2001-01
0 !HISTORY 2002-05-07 [unknown] BFC Certification
0 !HISTORY 2002-06-11 [PTadmin] Official Update 2002-03
0 !HISTORY 2007-05-07 [PTadmin] Header formatted for Contributor Agreement
0 !HISTORY 2008-07-01 [PTadmin] Official Update 2008-01

1 16 0 4 0 1 0 0 0 -5 0 0 0 1 stud4.dat

0 BFC INVERTNEXT
1 16 0 24 0 16 0 0 0 -20 0 0 0 16 box5.dat

4 16 20 24 20 16 24 16 -16 24 16 -20 24 20
4 16 -20 24 20 -16 24 16 -16 24 -16 -20 24 -20
4 16 -20 24 -20 -16 24 -16 16 24 -16 20 24 -20
4 16 20 24 -20 16 24 -16 16 24 16 20 24 20

1 16 0 24 0 20 0 0 0 -24 0 0 0 20 box5.dat

1 16 10 0 10 1 0 0 0 1 0 0 0 1 stud.dat
1 16 -10 0 10 1 0 0 0 1 0 0 0 1 stud.dat
1 16 10 0 -10 1 0 0 0 1 0 0 0 1 stud.dat
1 16 -10 0 -10 1 0 0 0 1 0 0 0 1 stud.dat

Example: pyramid

The following file is a building instruction for a simple pyramid as a Lego model:

0 Example Pyramid for Demonstration of LDRAW Library
0 Name: pyramid.ldr
0 Author: James Jessiman

1 1 -40 -24 60 1 0 0 0 1 0 0 0 1 3001.dat
1 1 40 -24 60 1 0 0 0 1 0 0 0 1 3001.dat
1 1 60 -24 0 0 0 1 0 1 0 -1 0 0 3001.dat
1 1 40 -24 -60 1 0 0 0 1 0 0 0 1 3001.dat
1 1 -40 -24 -60 1 0 0 0 1 0 0 0 1 3001.dat
1 1 -60 -24 0 0 0 1 0 1 0 -1 0 0 3001.dat

0 STEP

1 4 -20 -48 40 1 0 0 0 1 0 0 0 1 3001.dat
1 4 40 -48 20 0 0 1 0 1 0 -1 0 0 3001.dat
1 4 20 -48 -40 1 0 0 0 1 0 0 0 1 3001.dat
1 4 -40 -48 -20 0 0 1 0 1 0 -1 0 0 3001.dat

0 STEP

1 14 0 -72 20 1 0 0 0 1 0 0 0 1 3001.dat
1 14 0 -72 -20 1 0 0 0 1 0 0 0 1 3001.dat

0 STEP

1 0 0 -96 0 1 0 0 0 1 0 0 0 1 3003.dat

0 STEP

Each line that begins with a "1" represents a stone in a certain color and position. Each line "0 STEP" begins a new construction section. In this way, the individual steps for building this pyramid can be easily and beautifully converted into graphical building instructions with a program.

Programs

The most popular programs for use with LDraw are

  • MLCad and LDCad , 3D editors for processing bricks and Lego models
  • LDView , a 3D viewer
  • LPub for creating step-by-step building instructions

Web links