Each section contains an overview of the characteristics common to all primitives within that category. Primitives are grouped into classes within each category - one class of primitive serving a similar purpose at different sizes or resolutions. For each class of primitive, a brief description of the purpose of the primitive is provided, with notes on its co-ordinate origin, default size and rules for scaling. A list of the available primitives is shown.
An understanding of the orientation of the co-ordinate axes is essential for authoring a part for LDraw. For reference
within this page the axes and their direction is shown in this diagram.
Rectilinear primitives
These rectilinear elements may be scaled in the {x}, {y} and {z} dimensions to make elements of any size. For example
1 16 0 0 0 40 0 0 0 1 0 0 0 20 rect.dat
would generate a 80LDu x 40LDu rectangle in the {x,z} plane.
Although the default orientation of the rect.dat primitive is in the {x,z} plane the LDraw language allows for this to be transformed
1 16 0 0 0 0 1 0 40 0 0 0 0 20 rect.dat
would generate a 80LDu x 40LDu rectangle in the {y,z} plane.
1 16 0 0 0 40 0 0 0 0 20 0 1 0 rect.dat
would generate a 80LDu x 40LDu rectangle in the {x,y} plane.
Two dimensional |
Top [16] |
|
Rectangle with all edges |
![]() |
This primitive represents a rectangle in the {x,z} plane and the four edges that bound it.
Its origin is at its centre and by default has a size of 2LDu in each of the {x} and {z} dimensions. To avoid matrix
arithmetic problems in some renderers, the third dimension ({y} in the default orientation) should be given a scaling
factor of 1. |
Three dimensional |
Rectilinear primitives [17] Top [18] |
|
Cuboid with all faces and edges |
![]() |
This primitive is used to define a cuboid. Its origin is the centre of the cuboid and by default has a size of 2LDu in each of the three dimensions. |
|
Cuboid with 5 faces and all edges |
![]() |
This primitive represents a cuboid missing the top {-y} face. Its origin is the centre of the (missing) top face and by default has a size of 2LDu in each of the {x} and {z} dimensions and 1LDu in the {y} dimension. |
|
Cuboid with 4 parallel faces and all edges |
![]() |
This primitive represents a cuboid missing the top {-y} and bottom {+y} faces. Its origin is the centre of the (missing) top face and by default has a size of 2LDu in each of the {x} and {z} dimensions and 1LDu in the {y} dimension. |
|
Cuboid with 4 adjacent and all edges |
![]() |
This primitive represents a cuboid missing the top {-y} and front {-z} faces, but with all its edges. Its origin is the centre of the (missing) top face and by default has a size of 2LDu in each of the {x} and {z} dimensions and 1LDu in the {y} dimension. |
|
Cuboid with 4 adjacent faces missing 1 edge |
![]() |
This primitive represents a cuboid missing the top {-y} and front {-z} faces and the edge between those faces. Its origin is the centre of the (missing) top face and by default has a size of 2LDu in each of the {x} and {z} dimensions and 1LDu in the {y} dimension. |
|
Cuboid with 4 adjacent faces missing 4 edges |
![]() |
This primitive represents a cuboid missing the top {-y} and front {-z} faces and all the edges of the missing front face. Its origin is the centre of the (missing) top face and by default has a size of 2LDu in each of the {x} and {z} dimensions and 1LDu in the {y} dimension. |
|
Cuboid with 4 adjacent faces missing 7 edges |
![]() |
This primitive represents a cuboid missing the top {-y} and front {-z} faces and all the edges of both missing faces. Its origin is the centre of the (missing) top face and by default has a size of 2LDu in each of the {x} and {z} dimensions and 1LDu in the {y} dimension. |
|
Cuboid with 3 adjacent faces missing 8 edges (in two parallel groups) |
![]() |
This primitive represents a cuboid missing the top {-y} and left {-x} and right {+x} faces and excludes all the edges of the left {-x} and right {+x} faces. Its origin is the centre of the (missing) top face and by default has a size of 2LDu in each of the {x} and {z} dimensions and 1LDu in the {y} dimension. |
|
Cuboid with 3 adjacent faces missing 2 edges |
![]() |
This primitive represents a cuboid missing the top {-y} and left {-x} and right {+x} faces and excludes the top edges of the left {-x} and right {+x} faces. Its origin is the centre of the (missing) top face and by default has a size of 2LDu in each of the {x} and {z} dimensions and 1LDu in the {y} dimension. |
|
Right-angled triangular prism with 3 faces |
![]() |
This primitive represents a triangular prism missing the top {-y} and bottom {+y} faces but including all edges. The left {-x} and front {-z} faces are perpendicular. Its origin is the right-angle corner of the (missing) top face and by default has a size of 1LDu in each of the {x} and {z} dimensions and 1LDu in the {y} dimension. |
Curved primitives
LDraw represents curved surfaces as polygons. For circular components two series of primitives are provided.
All the circular primitives are orientated in the {x,z} plane with their origin at the centre of the circle and a
default radius of 1 LDu. Primitives are provided for complete circles and for commonly used fractions of a complete circle.
Where the naming convention includes a prefix of the form n-f this indicates the fraction (n/f) of the circle drawn
by the primitive. Where this fraction is less than an entire circle, the primitive starts at {+x,0} and progresses in a
conterclockwise direction when viewed from above {-y}.
![]() |
![]() 1-8disc |
![]() 1-4disc |
![]() 2-4disc |
![]() 3-4disc |
![]() 4-4disc |
These circular elements may be scaled by the same factor in both the {x} and {z} dimensions to make circular elements of greater or less than 1LDu radius. For example
1 16 0 0 0 3 0 0 0 1 0 0 0 3 4-4edge.dat
would generate a circle in the {x,z} plane with a diameter of 3LDu.
They may also be scaled asymmetrically in the x and z dimension to make ellipses.
Although the default orientation is in the {x,z} plane the LDraw language allows for these to be transformed
1 16 0 0 0 0 1 0 3 0 0 0 0 3 4-4edge.dat
would generate a circle in the {y,z} plane
1 16 0 0 0 3 0 0 0 0 3 0 1 0 4-4edge.dat
would generate a circle in the {x,y} plane
Two dimensional |
Curved primitives [19] Top [20] |
|
Circular line segment |
![]() |
This suite of primitives are used for edges which comprise an entire or part circle. |
|
Circular disc sector |
![]() |
This suite of primitives are used for surfaces which comprise an entire or part circle. |
|
Inverse of circular disc sector |
![]() |
This suite of primitives pad their matching n-fdisc.dat primitives out to the bounding square.
They are used to integrate circular elements into rectilinear elements. |
|
Circular ring segment |
![]() |
This suite of primitives are used to generate circular rings or part rings. The numeric suffix r in the
filename indicates the inner radius of the ring - the outer radius is 1LDu greater. For example a n-fring4 primitive
would create a ring with an inner radius of 4LDu and an outer radius of 5LDu. |
Three dimensional |
Curved primitives [21] Top [22] |
|
Circular cylinder | |||
![]() |
This suite of primitives are used to generate cylinder or part cylinders. | |||
|
Circular cylinder truncated by an angled plane | |||
1-4cyls.dat ![]() 3-8cyls.dat ![]() 2-4cyls.dat ![]() 1-4cyls2.dat |
These primitives are used to generate cylinders or part cylinders which
are truncated by a plane which is not perpendicular to the axis of the cylinder. The default angle of the plane is 45
degress.
Currently available primitives : Regular resolution : 1-4cyls, 3-8cyls, 2-4cyls, 4-4cyls, 1-4cyls2 | |||
|
Circular cone | |||
![]() |
This suite of primitives are used to generate circular cones or part cones. The numeric
suffix r in the filename indicates the inner radius of the cone - the outer radius is 1LDu greater. By default the
cone is 1LDu high in the {+y} dimension with the origin at the centre of the outer diameter.
For example a n-fcone4 primitive would create a cone with an inner radius of 4LDu and an outer radius of 5LDu. | |||
|
Circular torus | |||
![]() inner ![]() outer ![]() tube |
This suite of primitives are used to generate circular torus sections.
By default all these
primitives produce a torus with a major radius of 1LDu, so typically need to be scaled up in the {x} and {z} dimensions.
The second and third characters of the filename ff denotes the sweep of torus, as an inverse fraction
(01=1/1, 02=1/2, 04=1/4, 08=1/8, 16=1/16, 48=1/48).
The fourth character denotes the section of a torus (i=inner, o=outer, q=tube - the combination of 2 inner and 2 outer
sections).
The last four chacters of the file name rrrr denote the tube
radius in LDu (1333=0.1333, 3333=0.3333).
| |||
|
Circular torus (obsolete) | |||
![]() |
This single primitive pre-dates the creation of the tffirrrr
and tfforrrr suite of primitives and will not be augmented. It produces a quarter torus with a major
radius of 2.5Ldu and a tube radius of 1LDu. | |||
| Sphere section | ||||
![]() |
| |||
|
Spherical corner | |||
![]() |
This primitive represents one octant (eighth) of a sphere,
centered at the origin {0,0,0} of radius 1.414, truncated by the sides of a cube with a
vertex at {1,1,1}. The boundaries of the resulting surface are circular and fit with 1-4edge.dat. | |||
Special purpose primitives
Technic axle primitives |
Top [23] |
These primitives represent various components of the technic axle and its matching hole. They are orientated in the {x,z} plane. Except where noted below, and in the {y} dimension only, these primitives should not be scaled.
|
Technic axle section |
![]() |
This primitive is comprises a 1LDu long section of technic axle, including its ends. It may be scaled in the {y} dimension to produce an axle of any length. |
|
Technic axle end |
![]() |
This primitive is used to produce the "plus-shaped" cross section of a technic axle. |
|
Technic axle hole - closed |
![]() |
This primitive produces a technic axle hole with the disc ends and all sides. It may be scaled in the {y} dimension as necessary. |
|
Technic axle hole - reduced |
![]() |
This primitive produces a technic axle hole with reduced teeth including the disc ends and all edges. It may be scaled in the {y} dimension as necessary. |
|
Technic axle hole - open one side |
![]() |
This primitive produces a technic axle hole with one side omitted. It may be scaled in the {y} dimension as necessary. |
|
Technic axle hole - open two opposite sides |
![]() |
This primitive produces a technic axle hole with two opposite sides omitted. It may be scaled in the {y} dimension as necessary. |
|
Technic axle hole tooth |
| This primitive represents one tooth of a technic axle hole. | |
|
Technic axle hole - tooth surface |
![]() |
This primitive used to produce the fill the "plus-shaped" cross section of a technic axle to the bounding circle. |
|
Technic axle hole - sides |
![]() |
This primitive is comprises a 1LDu long section of outer sides of a technic axle. It may be scaled in the {y} dimension. |
|
Technic axle hole perimeter |
![]() |
This primitive is comprises a 1LDu long section of technic axle, without any ends. It may be scaled in the {y} dimension as necessary. |
|
Technic axle hole - side edges |
![]() |
This primitive produces the edges at the ends of the "plus-shaped" technic axle. |
|
Technic axle hole - tooth outer edges |
![]() |
This primitive produces the outer edges of the teeth of a technic axle hole. |
|
Technic axle hole - tooth inner edges |
![]() |
This primitive produces the inner edges of the "plus-shaped" technic axle. |
Technic bush primitives | Special purpose primitives [24] Top [25] |
These primitives are various representations of the castellated technic bush. They are orientated with the technic axle hole along the {y} axis and should not be scaled.
|
Technic 16-tooth castellation - long teeth |
![]() |
|
|
Technic 16-tooth castellation - regular teeth |
![]() |
|
|
Technic 16-tooth castellation - regular teeth indented |
![]() |
This primitive differs from bushloc2.dat in that the teeth are indented in four places to allow it to fit between four adjacent studs. |
|
Technic 16-tooth castellation - short teeth |
![]() |
|
|
Curved end to technic 1xn plate with 16-tooth castellation on underside |
![]() |
Technic connector primitives |
Special purpose primitives [26] Top [27] |
These primitives are used to contruct technic connector pegs. They are orientated with the technic axle hole along the {y} axis and should not be scaled.
|
Technic connector - long with collar |
![]() |
|
|
Technic connector - long without collar |
![]() |
|
|
Technic connector - short with collar |
![]() |
|
|
Technic connector - short without collar |
![]() |
|
|
Technic connector - long with collar and slot |
![]() |
|
|
Technic connector hole |
![]() |
|
|
Technic connector hole - 180 degrees |
![]() |
|
|
Technic connector hole - 90 degrees |
![]() |
|
Stud primitives | Special purpose primitives [28] Top [29] |
Each studxxx primitive described below has a matching low resolution stu2xxx primitive, used by the fast-draw mode of renderers - these stu2xxx primitive should never be used in part files. An additional primitive (studline.dat) is used to substitute a single line for studs by the super fast-draw mode of LDraw.
All stud primitives are modelled with the solid disc uppermost, even if designed for the underside of parts (stud3, stud4, stud8). The origin is as the base of the stud and they extend for 4LDU in the {-y} dimension. To use for the underside, the primitive need to be inverted in the {y} dimension, viz.
1 16 x y z 1 0 0 0 -1 0
0 0 1 stud3.dat
These primitives should not be scaled in the {x} or {z} dimensions. Ideally they should not be scaled in the {y} dimension either, to allow the accurate substitution of chamfered studs by high-quality renderers [but this rule is flouted in the regular brick files, where stud4 is scaled by 5 to generate the underside tube].