LDCad, Roland Melkert’s model editor, keeps its own information in type 0 lines that begin
0 !LDCAD. The keyword is followed by any number of
[name=value] pairs. A parameter that is left out has its
default. This page follows the published meta documentation, which dates from the 1.x
releases, and adds what the files and change log of version 1.7 Beta 2b show beyond it.
Values
| Type | Written as |
|---|---|
| number | An integer, or a decimal with . as the decimal mark. |
| boolean | true or false. |
| string, enum | Text without [, ] or line breaks; an enum is one of the listed words. |
| part reference | A file name found through the library search paths, with \ between folders. |
| file name | A path relative to the file that contains the line. |
| colour | An LDraw colour number held in 32 bits; the usual default is 16. |
| length with unit | A number in LDraw units, or followed by mm or % where the parameter allows it. |
| array, list | An array is separated by spaces, a list by commas. |
| position and orientation | posOri is twelve numbers: x y z and a 3 × 3 matrix, in the order of a type 1 line. A 3 × 3 matrix alone is nine numbers. |
Groups
| Line | Meaning |
|---|---|
GROUP_DEF [topLevel=true] [LID=0] [GID=…] [name=…] [center=x y z] | Defines a group. Header only, and repeated in every sub-file that holds members. LID is the number used inside the file, GID a globally unique string. name and center are written only for a top-level group; its name is unique among those. |
GROUP_NXT [ids=n…] [nrs=n…] | The next line belongs to the groups with these local numbers; nrs gives its position in each, one number per group. Ignored if the next line is not one LDCad supports. |
GROUP_OBJ [ids=n…] [nrs=n…] [refName=…] | Header only. Group membership of an object that LDCad creates itself and does not save as a line, such as Path start. |
Markers, scripts and generated content
| Line | Meaning |
|---|---|
MARKER [posOri=…] [lengths=30 30 30 30 30 30] [isTemp=false] [name=…] | A positioning aid. lengths are the arms towards −x, +x, −y, +y, −z and +z. A temporary marker is dropped at the next save. |
SCRIPT [source=file] | Header only, one per sub-file: the Lua script bound to the model. The script registers animations and macros through LDCad’s ldc module; the script language is not part of the LDraw file. |
GENERATED [generator=…] | The lines that follow are fall-back geometry maintained by LDCad, for programs that cannot build the content themselves. generator is information only. |
GENERATED … [master=part] | The whole sub-file is managed on behalf of the named model, which must be in the same MPD, and may be removed with its 0 FILE line. |
The list of recognised words inside the 1.7 Beta 2b program also holds
PRIMITIVE, PART and MODEL among the meta
keywords, but they are not !LDCAD metas. They close an old form of the
file type line: 0 Official, 0 Unofficial or
0 Un-official, then Part, Model or
Primitive and nothing more, as in 0 Unofficial Model. LDCad
takes the type of the file from the last word, and notes whether the line said
official.
Flexible content
0 !LDCAD CONTENT in the header makes the sub-file a flexible part that LDCad
builds from path or spring lines.
| Parameter | Default | Meaning |
|---|---|---|
type | path or spring. | |
addFallBack | default | default, never, always or remove. In normal locations the default is to add fall-back geometry; in template locations it is to remove it. |
quality | notSet | notSet, LQ or HQ: marks the low and high quality versions of a template. Added after the published documentation. |
looped | false | Path: the end joins the start. |
displayKind | mm | Path: show the length in mm, segments (segs) or links; later versions add L. |
curveStep | 0.0 | Path: step used to follow the curve; 0 is the built-in value. Set it to the segment length for segments of fixed shape. |
displayLenCor | 0 | Path: correction added to the length shown. |
cRes, cResLD | 16 | Spring: resolution of the coil, on screen and in the fall-back geometry. |
cDia | 8.0 | Spring: inner diameter of the coil. |
cRoll | 0.0 | Spring: rotation of the coil in degrees. |
wRes, wResLD | 8 | Spring: resolution of the wire. |
wDia | 2.0 | Spring: thickness of the wire. |
wCol | 16 | Spring: colour of the wire. |
sepMesh | false | Spring: put the coil geometry in its own sub-file even when colour 16 would allow it not to be. |
Path parts
The PATH_ lines stand in the header. A path needs at least one skin.
| Line | Parameters and defaults |
|---|---|
PATH_POINT | A control point. type bezier (default) or circle; posOri, whose local Y axis is the direction; prevCPDist and nextCPDist (25.0), the distances to the Bézier handles; cirR (25.0) and cirDir xyCW (default), xyCCW, zyCW or zyCCW for a circle; prevYRoll and nextYRoll (0.0), roll about the skin’s Y axis in degrees. |
PATH_CAP | A part closing one end. group start or end; color (16); posOri; part; extraLen (0mm), length it adds to the part’s total; inlineRef, copy the cap’s lines into the file, applied only if it consists wholly of type 1 lines. |
PATH_ANCHOR | The attachment frame of one end, one per group: group, posOri. |
PATH_LENGTH | A length variant: lenTarget and lenMargin (0), partName (a part number, never loaded) and partDescr. The line closest to the true length applies. |
PATH_SKIN | The geometry laid along the path, below. Several skins share the length. |
PATH_SKIN
| Parameter | Default | Meaning |
|---|---|---|
donPart | The donor part that is repeated or bent along the path. | |
donCol | 16 | Its colour. |
donOri | identity | 3 × 3 matrix turning the donor so that it runs along Y. |
donYSize | 100% | Base length of the donor; a percentage is of its own length. |
donCen | absCen | partCen, absCen, absYCen or absXZCen: the point of the turned and scaled donor that is placed. |
donCenYOfs | 0.0 | Y offset of that point; mm and % allowed. |
donFinScale | fitDon2Seg | none keeps the final donor size, fitDon2Seg scales the donor to the final segment size, and later versions add segMerge, which only merges segments. |
donPlace | refsStat | refsStat places references of fixed shape; deform bends the donor’s geometry. refsDyn is no longer supported and is read as static placement. |
donYAlign | 0 | Alignment on the segment: −1 is left, 0 centre, 1 right, each step a donor length. |
donInline | false | Copy the donor’s lines instead of referring to it; only for a donor made wholly of type 1 lines. |
donZSize | Appears in one bundled template, bracelet.ldr, always 8, 12 or 14 according to the donor named. It is not a recognised parameter: the published documentation does not list it, and the 1.7 Beta 2b program does not hold the name, so that version ignores it and the value has no effect. It therefore carries no meaning in the format. | |
segSize | 100% | Target segment length: a percentage of donYSize, or in LDraw units or mm. |
segSizeTol | 5% | Tolerance when scaling segments to fit. |
segsCnt | 0 | Number of segments; 0 is unlimited. |
segsGrp | 0 | Skins with the same non-zero number take turns. |
segsMaxMerge | 1 | Most segments merged into one; 0 is unlimited. |
segsMrgAng | 0.0 | Segments are merged while the angle between first and last stays below this, in degrees; 0 is the built-in value. |
segsMrgRollAng | 0.0 | The same limit for the roll angle. Added after the published documentation. |
segsEdgeDelKind | keepFirstLeft | keepFirstLeft, keepLastRight or keepAll: which overlapping conditional lines survive deformation. |
Spring parts
| Line | Parameters and defaults |
|---|---|
SPRING_POINT | An end of the coil, at most two: group start or end, posOri. |
SPRING_CAP | A part at an end: group, color (16), posOri, part, and in later versions inlineRef as for a path cap. |
SPRING_ANCHOR | The attachment frame, one per group: group, posOri. |
SPRING_SECTION | A run of the coil, at least one: windingCnt (5.0) windings; proportion (1), the section’s share of the length left over. With 0 the section is tightly wound, its length set by the windings and the wire. |
Part snapping
These lines say where parts connect. They are mostly kept in the shadow library rather
than in parts. A snap point faces −Y at rest. Most lines take ID (a name
used for clearing), group, pos, ori, and
gender M or F.
| Line | Meaning and further parameters |
|---|---|
SNAP_CLEAR [id=…] | Removes inherited snap information with that name; without a name, all of it. |
SNAP_INCL | Takes in the snap lines of the part files named by ref, placed by pos and ori, not recursively; may have a grid. The published text also lists scale, which the change log removes. |
SNAP_CYL | A cylinder, male by default. secs is a list of shape radius length blocks: R round, A axle, S square, _L a flexible extension of the previous block and L_ of the next. R 8 4 is a stud, R 8 2 R 6 16 R 8 2 a beam hole. caps none, one (default: a male closes end A, a female end B), two, A or B; center and slide (false). |
SNAP_CLP | A clip, female: radius (4.0), length (8.0), center, slide. |
SNAP_FGR | Interlocking fingers: seq, the finger widths; genderOfs, the gender of the first (default M); radius; center. |
SNAP_GEN | A general point with a bounding volume bounding: pnt, box x y z, cube s, cyl r length or sph r. Generic points match only each other, by group name; the bounding volume helps to pick between several candidates. Two further parameters are missing from the published documentation. match is the level at which pairs are matched: group, shape (the default) or size. In 1.7 Beta 2b every level first requires the same group and opposite genders. group asks nothing more; shape also requires the two bounding volumes to be of the same kind (pnt, box, cube, cyl or sph); size also requires their dimensions to be equal, compared in hundredths of a unit. When the two points name different levels, the test uses the level of one of them, the one it is run on.placement is how a matched pair is turned: abs (the default), which the program labels “Absolute”, or free, which it labels “Retain orientation”. In 1.7 Beta 2b a value it does not recognise is read as the default, and a value equal to the default is left out when the line is written. |
SNAP_SPH | An older sphere form with radius; it is read and converted to SNAP_GEN with match=size and placement=free. |
| Shared parameter | Meaning |
|---|---|
scale | What an inherited point does when the reference to its file is scaled: none (default), YOnly, ROnly or YandR (length, radius or both follow). |
mirror | What it does when the reference is mirrored: none (default) or cor, correct automatically; later versions add corX, corY and corZ, correct about that axis. |
grid | Repeats the point: Xcount Zcount Xstep Zstep, or with a Y axis Xcount Ycount Zcount Xstep Ystep Zstep. C before a count centres that direction, as in C 2 C 2 20 20. |
Mirroring and hints
| Line | Meaning |
|---|---|
MIRROR_INFO | How to mirror a part. baseFlip X, Y or Z: the axis of the first flip, preferably a symmetrical one. counterPart: self, auto or the name of the opposite-handed part. posCor x y z: a centre to use with the counterpart. oriCor: a 3 × 3 matrix applied to the counterpart before mirroring. inheritable: files that refer to this one directly inherit the line if they have none. The last such line in a file, shadow content included, applies. |
HINTS | binOri: a 3 × 3 matrix correcting the orientation of the part’s thumbnail. fakeSeam (the library writes no): overrides the shrinking of parts that exports use to show seams. Only the last such line applies. |
Shadow libraries, templates and donors
A shadow library is a folder laid out like the parts library (parts/,
parts/s/, p/), or a ZIP of it renamed .csl. When
LDCad loads a library file it also loads the file of the same name in the shadow library
and adds that file’s meta lines to the part in memory; the official files are not
changed. The default one, offLibShadow.csl, carries snapping, mirroring and
hint lines. Its files are UTF-8 and may hold only a few header metas besides the
SNAP_, MIRROR_INFO and HINTS lines.
Templates are ordinary single-file LDraw documents that are copied into a model, and
donors are ordinary .dat parts used by path skins, found through the search
paths. Neither adds any syntax. A template must not be a multi-part document, and only
line types LDCad supports are copied from it; its header decides which part bin groups
show it.
LDCad’s own settings are not LDraw files. They are plain INI-like text:
main.cfg (preferences and program state), seeds.cfg (which
seed archives have been unpacked where; the .sf seeds are ZIP files) and an
optional LDCad.cfg beside the program. That last file has
[paths] (such as templatesDir, donorsDir and
shadowDir, which may use <appDir>,
<appSubDir>, <userAppDataDir> and
<userDocDir>), [options] (readOnly,
useSeeds, useSingleInstance) and [defaults]
(ipcIDStr, defLibCSL, defConfigLDR).
0 !LDCAD CONTENT [type=spring] [addFallBack=default] [cRes=16] [cResLD=16] [cDia=16] [cRoll=0] [wRes=8] [wResLD=8] [wDia=0.5mm] [wCol=494] [sepMesh=false]
0 !LDCAD SPRING_POINT [group=start] [posOri=0 -108 0 1 0 0 0 1 0 0 0 1]
0 !LDCAD SPRING_POINT [group=end] [posOri=0 -188 0 1 0 0 0 1 0 0 0 1]
Sources
- LDCad: LDCad metas – parameters, types and defaults
- LDCad: Shadow library – how shadow content is merged
- LDCad: Templates and donors
- LDCad: Config files
- LDCad: Scripting examples and Scripting API
- LDCad shadow library –
CONTRIBUTING.mdand the values its parts use (CC BY-SA 4.0) - LDCad 1.7 Beta 2b – the change log, bundled templates, the program’s own help texts and a static reading of the Linux program’s machine code, for the parameters added after the published documentation, the defaults of
matchandplacement, what eachmatchlevel compares, and the old file type line