LDraw

{{Infobox website

| name = LDraw

| favicon =

| screenshot = LDraw.org.png

| url = {{URL|https://www.ldraw.org/}}

| commercial = No

| registration = Free

| area_served = Worldwide

| owner = LDraw.org

| author = James Jessiman

| launch_date =

| current_status = Online

| revenue =

}}

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,{{cite web |title=LDraw.org - File Format 1.0.2 |url=https://www.ldraw.org/article/218.html |access-date=9 July 2019 |work=LDraw.org}} although the file format has since evolved and extended.{{Cite web |title=LDraw.org - CATEGORY and KEYWORDS Language Extension |url=https://www.ldraw.org/article/340.html |access-date=2019-07-09 |website=www.ldraw.org}}{{Cite web |title=LDraw.org - Colour Definition Language Extension |url=https://www.ldraw.org/article/299.html |access-date=2019-07-09 |website=www.ldraw.org}}{{Cite web |title=LDraw.org - Language Extension for Back Face Culling (BFC) |url=https://www.ldraw.org/article/415.html |access-date=2019-07-09 |website=www.ldraw.org}}{{Cite web |title=LDraw.org - MPD Language Extension |url=https://www.ldraw.org/article/47.html |access-date=2019-07-09 |website=www.ldraw.org}}{{Cite web |title=LDraw.org - Official Model Repository (OMR) Specification Version 1.0.3 |url=https://www.ldraw.org/article/593.html |access-date=2019-07-09 |website=www.ldraw.org}}{{Cite web |title=LDraw.org - Language Extension for Texture Mapping |url=https://www.ldraw.org/documentation/ldraw-org-file-format-standards/language-extension-for-texture-mapping.html |access-date=2019-07-09 |website=www.ldraw.org}}{{Cite web |title=LDraw.org - Localisation Guideline |url=https://www.ldraw.org/article/559.html |access-date=2019-07-09 |website=www.ldraw.org}} He also modeled many of the original parts in the parts library, which is under continuous maintenance and extension by the LDraw community.

Following Jessiman's death in 1997,{{sfn|Courtney|Bliss|Herrera|2003|p=396}}{{cite web |author=OrionP |date=8 November 2003 |title=James Jessiman Memorial |url=https://www.ldraw.org/article/222 |access-date=9 July 2019 |work=LDraw.org |quote=On July 25, 1997, James Jessiman passed away.}} 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 2003, 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 (LSC for short), elected by users of LDraw.org forum. Core members of LDraw.org are in close ties with James Jessiman's family, which is the owner of the LDraw™ registered trademark.

= James Jessiman Memorial Award =

{{See also|List of web awards}}

{{Infobox award

| name = James Jessiman
Memorial Award

| image = James Jessiman Memorial Award.png

| awarded_for = "Contribution to the furthering of LDraw, the DAT format, and James' memory."{{cite web|url=https://ldraw.org/article/222.html|title=James Jessiman Memorial Award|publisher=LDraw.org|accessdate=2024-09-01}}

| country = Australia

| year = 2009 - Present

| website = {{url|https://ldraw.org/article/222.html|ldraw.org}}

| image2 = LDraw.org.png

}}

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.{{Cite web |title=LDraw.org - James Jessiman Memorial |url=https://ldraw.org/article/222.html |access-date=2024-09-29 |website=ldraw.org}}

= Recipients =

  • 2001 – Steve Bliss
  • 2002 – not awarded
  • 2003 – Jacob Sparre Andersen
  • 2004 – Lars C. Hassing
  • 2005 – Michael Lachmann
  • 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
  • 2016 – Nils Schmidt
  • 2017 – Chris Dee
  • 2018 – Michael 'Mike' Heidemann
  • 2019 – Gerald Lasser
  • 2020 – Lasse Deleuran
  • 2021 – Leonardo Zide,{{Cite web |title=Meet Leonardo Zide |url=https://wiki.ldraw.org/wiki/Meet_Leonardo_Zide |access-date=2024-09-29 |website=wiki.ldraw.org}}{{Cite web |title=Scalable Ambient Obscurance |url=https://research.nvidia.com/publication/2012-06_scalable-ambient-obscurance |access-date=2024-09-30 |website=research.nvidia.com |type=Research}}{{Cite news |last=McGuire |first=Morgan |last2=Mara |first2=Michael |last3=Luebke |first3=David |date=2012-06-25 |title=Scalable ambient obscurance |url=https://dl.acm.org/doi/abs/10.5555/2383795.2383810 |access-date=30 September 2024 |work=Proceedings of the Fourth ACM SIGGRAPH / Eurographics conference on High-Performance Graphics |publisher=Eurographics Association |pages=97–103 |language=en |isbn=978-3-905674-41-5 |quote=We thank Naty Hoffman (Activision Studio Central), Leonardo Zide (Treyarch), and Louis Bavoil (NVIDIA) for their input on this paper and implementation, [...].}} software engineer at Treyarch, author of LeoCAD (an open-source program for creatiing virtual Lego models with LDraw).
  • 2022 – Takeshi Takahashi
  • 2023 – Massimo Maso
  • 2024 – Evert-Jan Boer

File format

{{Infobox file format

| name = LDraw

| extensions = .dat, .ldr, .mpd

| developer = James Jessiman, LDraw.org

| type = 3D computer graphics, text file

| standards = Lego

| free = yes

| open = yes

| url = {{URL|https://ldraw.org}}

}}

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 =

File:Lego dimensions.svg

File:LeoCAD ruler mm.png with "ruler" part (ruler tick: 1 mm)]]

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.

class="wikitable" style="text-align: right"

|+Units comparison table

!1 =

!LDU

!mm

!LU

!Flat

!P

!Stud

!Brick

!in

!Comment

style="text-align:center;|LDU

|style="background:#000000;|

|0.4

|{{frac|1|4}}

|{{frac|1|8}}

|{{frac|1|20}}

|{{frac|1|20}}

|{{frac|1|24}}

|{{frac|1|64}}

|style="text-align:left;|LDraw Unit{{Cite web|url=https://ldraw.org/article/218|title=LDraw.org - LDraw File Format Specification|website=ldraw.org|access-date=2024-09-25}}{{Cite web|url=https://philohome.com/calipers/cali.htm|title=LDraw measuring tools|website=philohome.com|access-date=2024-09-25}}{{Cite web|url=http://studs.sariel.pl|title=LEGO Unit Converter|website=studs.sariel.pl|access-date=2024-09-25}} — base unit

style="text-align:center;|mm

|2{{frac|1|2}}

|style="background:#000000;|

|{{frac|5|8}}

|{{frac|5|16}}

|{{frac|1|8}}

|{{frac|1|8}}

|{{frac|7|64}}

|{{frac|3|64}}

|style="text-align:left;|millimetre = 0.1 cm = 0.01 dm = 0.001 m

style="text-align:center;|LU

|4

|1.6

|style="background:#000000;|

|{{frac|1|2}}

|{{frac|1|5}}

|{{frac|1|5}}

|{{frac|1|6}}

|{{frac|1|16}}

|style="text-align:left;|Lego Unit{{Cite web|url=https://www.designreview.byu.edu/collections/the-lego-brick|title=The LEGO Brick|date=2019-12-18|website=The BYU Design Review|language=en-US|access-date=2024-09-25}} = 1 p («plastic»{{Cite web|url=https://brickarchitect.com/scale/|title=LEGO figures in Scale models|last=Alphin|first=Tom|website=BRICK ARCHITECT|language=en-US|access-date=2024-09-25}}) — thickness of brick wall

style="text-align:center;|Flat

|8

|3.2

|2

|style="background:#000000;|

|{{frac|2|5}}

|{{frac|2|5}}

|{{frac|1|3}}

|{{frac|1|8}}

|style="text-align:left;|plate height without pin — distance between edges of closest pins

style="text-align:center;|P

|20

|8.0

|5

|2{{frac|1|2}}

|style="background:#000000;|

|1

|{{frac|5|6}}

|{{frac|5|16}}

|style="text-align:left;|pin step— distance between centers of two closest pins

style="text-align:center;|Stud

|20

|8.0

|5

|2{{frac|1|2}}

|1

|style="background:#000000;|

|{{frac|5|6}}

|{{frac|5|16}}

|style="text-align:left;|1x1 brick width (real width: P-0.2 mm = 7.8 mm)

Brick

|24

|9.6

|6

|3

|1{{frac|1|2}}

|1{{frac|1|2}}

|style="background:#000000;|

|{{frac|3|8}}

|style="text-align:left;|brick height without pin

style="text-align:center;|in

|64

|25.4

|16

|8

|3{{frac|1|5}}

|3{{frac|1|5}}

|3{{frac|1|12}}

|style="background:#000000;|

|style="text-align:left;|inch = {{frac|1|12}} feet = {{frac|1|36}} yard

colspan="10" style="text-align:left;|Notes: dimension in and mm are approximated (in mm — rounded to the first decimaldigit)

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,{{Cite web|url=http://www.holly-wood.it/ldraw/helper-en.html|title=Holly-Wood.it > LDraw > Helper parts|website=www.holly-wood.it|access-date=2024-10-03|quote=HlduR.dat (Helper - LDU Ruler).}} that could be used directly in LDraw editors during visual modeling, that especially useful for scale model making.

= Scale =

LDraw, same as Lego, uses 1:42½ (Lego minifigure scale) as base for scaling real world object for scale modeling. Its may drift between 1:40 to 1:43, which are popular among other interests.

= 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:{{sfn|Courtney|Bliss|Herrera|2003|p=322}}

  • 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 =

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

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).{{sfn|Courtney|Bliss|Herrera|2003|pp=152-153}} 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.

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

Other examples

File:Lego CAD Racecar.JPG|A racecar created with LDraw

File:Ldraw datsville 01.png|A small town built using the LDraw system of tools and rendered in POV-Ray. The model contains about 250,000 parts.

File:LeoCAD Screenshot with edge lines Flyer from LEGO Masters DK S01E07.png|A flying mechanism that was built in Lego Masters Denmark rebuilt in LeoCAD

File:Flyer from LEGO Masters DK S01E07 4K rendering.png|4K rendering of the flying mechanism generated via POV-Ray render option inside LeoCAD

File:Spaceship 1.jpg|A spaceship built in LDCad

File:Bricksmith.png|Car viewed using Bricksmith

See also

References

{{Reflist}}

Further reading

  • {{cite book|title=Virtual LEGO: The Official LDraw.Org guide to LDraw Tools for Windows|first1=Tim|last1=Courtney|first2=Steve|last2=Bliss|first3=Ahui|last3=Herrera|location=San Francisco|year=2003|publisher=No Starch Press|isbn=978-1-886411-94-4}}
  • {{cite book|title=LEGO Software Power Tools: including LDraw, MLCad, and LPub|first=Kevin|last=Clague|publisher=Syngress|location=Rockland, Mass|year=2002|isbn=978-1-931836-76-0}}