The parts library the ldrawjs editor loads: every part of the LDraw parts library as a 3D model, a picture and a list of the places where it connects to others, with a catalog and the colour table. Published at https://ldrawjs.github.io/ldrawjs-db/.
Nothing here is written by hand. The files are made by ldrawjs-utils, and made again when the LDraw library has a new release. This page is the specification of their formats.
| File | |
|---|---|
parts/<id>.glb |
One 3D model per part, as binary glTF 2.0. |
thumbnails/<id>.png |
One 256 x 256 picture per part. |
connectors/<id>.json |
Where each part connects to others: studs, holes, pins, clips. |
catalog.json |
What parts exist, and how to find them. |
colors.json |
The LDraw colour table. |
manifest.json |
A report of the run that made the part files. |
connectors-manifest.json |
A report of the run that made the connector files. |
A part's <id> is its LDraw file name without .dat, in lowercase
(3001, 3626cp01), and is the same in every folder.
Each part is a standard binary glTF 2.0 file. Anything that reads glTF can open one. A few conventions matter to a program that wants to place parts in a model and colour them:
-
Units and axes are baked in. LDraw measures in LDU (0.4 mm) with -Y up; the files are in metres with +Y up, and a part's front faces +Z. A point
(x, y, z)of LDraw is at0.0004 · (x, −y, −z). The part's own origin is kept. -
Placing a part. An LDraw rotation matrix
MbecomesC · M · CwithC = diag(1, −1, −1), and its position(x, y, z)becomes0.0004 · (x, −y, −z). -
Positions are integers. They are stored as 16-bit integers (
KHR_mesh_quantization, the only extension used) on a grid of 1/128 LDU or, for parts that reach further than 256 LDU from their origin, a coarser power of two. The node'sscaleturns them into metres, so a reader must apply it. There is no translation on the node. Normals are normalised signed bytes. -
Colours go by material name. Geometry is split by which colour it takes once the part is placed:
Material Meaning ldraw:16The colour the part is given. ldraw:24The edge colour that goes with it. ldraw:<code>A colour fixed in the part: prints, multi-colour parts. ldraw:<code>:edgeThe edge colour that goes with a fixed colour. ldraw:0x2RRGGBBA fixed colour given directly as RGB. -
One mesh, two kinds of primitive. Surfaces are triangles with positions, normals and indices. Edge lines are
LINESprimitives. -
Faces whose direction LDraw does not vouch for are written twice, once each way, so every material can be single-sided.
-
Conditional lines are left out unless asked for with
--conditional-lines. They would be about a third of each file, and a renderer with smooth shading does not need them. -
Attribution travels with the file.
asset.copyrightholds the part's author and licence, andasset.extras.ldrawits original file name and description.
Every file passes the Khronos glTF validator without errors or warnings.
catalog.json lists every part that has a part file, and how to find it.
{
"version": 1,
"source": "LDraw parts library, https://www.ldraw.org, CC BY 4.0",
"libraryUpdate": "2026-10",
"categories": ["Animal", "Antenna", "..."],
"flags": { "pattern": 1, "sticker": 2, "internal": 4, "alias": 8, "physicalColour": 16, "thirdParty": 32, "shortcut": 64 },
"parts": {
"id": ["23714", "62575p01", "..."],
"description": ["Animal Ant", "Animal Ant with Marbled Trans Brown Pattern", "..."],
"category": [0, 0, "..."],
"keywords": ["", "Bricklink 62575pb01, Jungle, Rebrickable 23714pat0001, set 7624, set 7626", "..."],
"flags": [0, 1, "..."]
},
"aliases": { "10": "10a", "100": "3665" }
}-
partsis column-oriented. Its five arrays have the same length, and the same index in each is the same part. Parts are in LDraw's own order: by description, with sizes in numeric order ("2 x 4" before "2 x 10"). -
idis the part's file name without.dat, in lowercase. It is the name of the part's files here (parts/<id>.glb,thumbnails/<id>.png,connectors/<id>.json) and what a model file calls the part. -
descriptionis LDraw's, tidied for reading: the padding inside sizes is removed ("Brick 2 x 4" becomes "Brick 2 x 4"), and so is the character LDraw puts in front to classify the part, which is inflagsinstead. -
categoryis an index intocategories, which is sorted by name. It is the part's!CATEGORYwhere it has one, and the first word of its description otherwise. -
keywordsis the part's!KEYWORDS, joined with ", ". Often ids used by other catalogs. -
flagsis a bit field. The meaning of each bit is in the top-levelflags, so that a reader need not hard-code the numbers:Flag Bit Set for pattern1 A printed part: "Pattern" in the description, or a pNNsuffix on the id.sticker2 A sticker, or a part with one applied: "Sticker" in the description, or a dNNsuffix.internal4 ~in front: a piece of another part, or obsolete. Not for use by itself.alias8 =in front, or an Alias type: another name for an existing part.physicalColour16 _in front, or a Physical_Colour type: a part fixed to one colour.thirdParty32 |in front: not made by the original manufacturer.shortcut64 A Shortcut type: several parts assembled into one. -
aliasesmaps the ids of parts that were renamed (LDraw's "~Moved to" files) to their current ids. Such an id has no files of its own; a model that uses it means the part it leads to. -
libraryUpdateis the newest LDraw release any of the parts belongs to, asyear-number.
colors.json is LDraw's colour table (LDConfig.ldr), sorted by code.
{
"version": 1,
"source": "LDConfig.ldr, LDraw parts library, https://www.ldraw.org, CC BY 4.0",
"colors": [
{ "code": 0, "name": "Black", "value": "#1B2A34", "edge": "#808080", "finish": "solid" },
{ "code": 33, "name": "Trans Dark Blue", "value": "#0020A0", "edge": "#000B38", "finish": "solid", "alpha": 128 }
]
}| Field | |
|---|---|
code |
The LDraw colour code: what a model file gives a part, and the number in the material names of the part files (ldraw:<code>). |
name |
LDraw's name, with spaces for its underscores. |
value |
The colour, as #RRGGBB in sRGB. |
edge |
The colour of the edge lines that go with it. |
finish |
solid, chrome, pearlescent, rubber, metal or material (glitter, speckle and the like). |
alpha |
0 to 255, only on a colour that is see-through. |
luminance |
0 to 255, only on a colour that glows. |
thumbnails/<id>.png is one picture per part: 256 x 256 pixels, RGBA with a
transparent background. The part is seen from the front, the right and
above, without perspective, and fills the picture. It is drawn in a neutral
light grey (#BFC4C8) where it takes the colour it is given; prints and
other fixed colours are their own.
connectors/<id>.json is the list for one part. Every part has a file; one
with nothing known about it has an empty list. A 2 x 4 plate:
{
"part": "3020",
"license": "CC BY-SA 4.0. Made from the LDCad Shadow Library ...",
"connectors": [
{ "kind": "cyl", "gender": "M", "caps": "A", "secs": [["R", 6, 4]], "pos": [-30, 0, -10], "grid": [4, 2, 20, 20] },
{ "kind": "cyl", "gender": "F", "caps": "B", "secs": [["R", 6, 4]], "pos": [-30, 8, -10], "grid": [4, 2, 20, 20] },
{ "kind": "cyl", "gender": "F", "caps": "A", "secs": [["R", 6, 4]], "pos": [-20, 4, 0], "grid": [3, 1, 20, 0],
"ori": [1, 0, 0, 0, -1, 0, 0, 0, -1], "tube": true }
]
}-
partis the part's id.licenseis there whenever the list is not empty. -
Units and axes are LDraw's, not those of the GLB files: LDU, -Y up, relative to the part's origin. They are what a model file is written in.
-
posandoriplace a connector.oriis a rotation, nine numbers row by row as LDraw writes a matrix, and is left out when it is the identity. A shape runs fromposalong the negative Y axis of its orientation: the stud above rises from the top of the plate, and the hole reaches up into it from the bottom. With"center": truethe shape lies half to each side ofposinstead. -
gridis[countX, countZ, stepX, stepZ]: the connector repeated along its own X and Z axes, the first one atpos. A 48 x 48 baseplate is one line. -
kindis one of:Kind Fields cylgender,secs,capsA cylinder: Mgoes intoF. Studs, pins, axles, bars, and the holes for them.clpradius,lengthA clip. It takes a bar: a male cylinder of its radius. fgrgenderOfs,seq,radiusThe fingers of a hinge: the gender of the first, the width of each, the radius of their tips where given. gengender,bounding,groupAnything else. Fits only another of the same group.boundingis a rough size:["box", x, y, z](half sizes),["cube", size],["cyl", radius, length],["sph", radius]or["pnt"].sphgender,radiusA ball, or the socket for one. The shadow library writes these as genat present, so none are published. -
secsis a cylinder's shape along its length, as[shape, radius, length]for each stretch:Rround,Aaxle,Ssquare;_LandL_are a rim that gives way, belonging to the stretch before or after. A stud is[["R", 6, 4]]; the hole in a Technic beam is[["R", 8, 2], ["R", 6, 16], ["R", 8, 2]]. -
capssays which ends of a cylinder are closed:none,A(the end atpos),B(the far end) ortwo. For a hole this is what says where it is entered, and it is not always atpos: the ordinary holes above are closed atBand open atpos, on the underside of the plate; the third line is written from its closed end, 4 below the top, and opens at the far end,posand four along the way it runs, which is the underside again. A hole withnoneis entered from either end. -
tubemarks the hole inside a tube under a part: the three tubes between the eight holes of the plate above. A stud fits in one, and the part then sits half a stud off, in both directions, from where its ordinary holes would put it. Such a hole has the shape of any other hole for a stud, so the mark is the only way to tell the two apart: to prefer the ordinary holes, or to leave the tubes out. A tube that the part has an ordinary hole for, opening at the same place, is written once, as that hole. -
slidemarks a connection the parts can slide along;group, where a connector has one, limits it to others of the same group;extraholds properties this tool does not know, as the shadow library wrote them ({"placement": "free"}). All three are left out when they do not apply. -
A round cylinder has no turn of its own. LDraw files turn studs about their own axis every which way, which means nothing for a round shape. Such a connector is written in the one orientation that goes with the way it points, so an upright stud has no
oriat all. Axles, square holes, clips and the rest keep the turn they were given.
Two parts join where a male and a female connector of matching shape are at
the same place, on the same axis. A brick sits on another when the open end
of its holes is at the pos of the other's studs. The files say where the
connectors are; what fits what, how much play there is, and whether the
parts then pass through each other, is for the program that uses them.
Coverage follows the shadow library. In the 2026-11 library 18,404 of 24,043 parts have at least one connector (every plate, 96% of bricks, 85% of Technic). A part the shadow library has no file for still has the studs its primitives give it, and the tubes under it, but not the ordinary holes underneath, which are written part by part. The tubes are not from the shadow library, which has them switched off; they are an addition of this project's, 25,738 of them in 4,142 parts.
Two files describe a run and are not needed to use the data.
manifest.json, from ldraw-to-glb:
| Field | |
|---|---|
generator, source, libraryUpdate |
What made the files, from what, and from which LDraw release. |
units, upAxis, ldrawUnitInMetres |
"metres", "+Y" and 0.0004: the space the part files are in. |
parts |
By id: file, description (as LDraw writes it), bytes, triangles, vertices, lines, conditionalLines. |
aliases |
The same map as in the catalog. |
empty |
Parts with nothing to draw, by id, with their description. They have no files. |
failed |
Parts that could not be converted, by id, with the reason. |
problems |
Parts that were converted with something amiss, by id: missingFiles (references that lead nowhere) and unparsedLines. |
connectors-manifest.json, from part-connectors:
| Field | |
|---|---|
generator, sources, license |
What made the files, from what, and the licence they are under. |
libraryUpdate, shadowCommit |
The LDraw release, and the commit of the shadow library. |
units, upAxis |
"LDU" and "-Y": the space the connector files are in. |
counts |
parts (files written), withConnectors, withoutConnectors, moved (renamed parts, which have no file), connectors (lines), places (what the lines stand for once their grids are counted out), placesByKind, and tubeHoles (how many of the places are holes inside tubes). |
shadowFiles |
all, used, and the list of those unused: shadow files for parts the LDraw library no longer has. |
additions |
The files that part-connectors/additions/ had lines for. |
problems.failed |
Parts whose file could not be written, by id. |
problems.unresolvedIncludes |
By file: the SNAP_INCL references that name no shadow file. |
problems.unreadableLines |
By file (shadow/... or ldraw/...): the shadow lines that could not be read, with line numbers. |
problems.snapsLostToReferences |
By the file the snaps were in: how many did not survive a reference, as scaled, mirrored or sheared. |
problems.unknownToThisProgram |
Properties and names the format's description does not have, with counts. |
problems.otherLdcadLines |
!LDCAD lines that are not about connecting, by name, with counts. |
parts/,thumbnails/,catalog.json,colors.jsonandmanifest.jsonare derived from the LDraw parts library, the work of the LDraw community, and are under CC BY 4.0. The attribution is written into every part file.connectors/andconnectors-manifest.jsonare also derived from the LDCad Shadow Library by Roland Melkert and its contributors, with a few lines added to it in ldrawjs-utils, and are under CC BY-SA 4.0: anything made from them has to be shared under the same licence. Each file that has connectors says so.
LDraw™ is a trademark owned and licensed by the Jessiman Estate. This is an independent, community project. It is not affiliated with, sponsored by or endorsed by any toy manufacturer.