Primitives Reference: Difference between revisions
Swampkryakwa (talk | contribs) (→Test) |
Holly-Wood (talk | contribs) No edit summary |
||
Line 232: | Line 232: | ||
| [[File:box3-12.png|200px|thumb|alt=Box3-12]] | | [[File:box3-12.png|200px|thumb|alt=Box3-12]] | ||
|| This primitive represents a cuboid missing the top {-y}, front {-z} and left {-x} faces but excludes all edges. Its origin is the centre of the (missing) top face and by default has a size of 2LDu in each of the {x}, {y} and {z} dimensions. | || This primitive represents a cuboid missing the top {-y}, front {-z} and left {-x} faces but excludes all edges. Its origin is the centre of the (missing) top face and by default has a size of 2LDu in each of the {x}, {y} and {z} dimensions. | ||
|} | | | ||
|- | |||
| '''box3u2p.dat''' || '''Cuboid with 3 faces missing 2 edges''' | |||
|- | |||
| [[File:box3u2p.png|200px|thumb|alt=Box3u2p]] | |||
|| 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. | |||
|- | |||
|- | |||
| '''box3u4p.dat''' || '''Cuboid with 3 faces missing 4 parallel edges''' | |||
|- | |||
| [[File:box3u4p.png|200px|thumb|alt=Box3u4p]] | |||
|| This primitive represents a cuboid missing the top {-y} and left {-x} and right {+x} faces and excludes the topand bottom 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. | |||
|- | |||
|- | |||
| '''box3u4a.dat''' || '''Cuboid with 3 adjacent faces missing all edges''' | |||
|- | |||
| [[File:box3u4a.png|200px|thumb|alt=Box3u4a]] | |||
|| This primitive represents a cuboid missing the top {-y} and left {-x} and right {+x} faces and excludes the edges of the missing top 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. | |||
| | |||
|- | |||
| '''box3u5p.dat''' || '''Cuboid with 3 faces missing 5 edges''' | |||
|- | |||
| [[File:box3u5p.png|200px|thumb|alt=Box3u5p]] | |||
|| This primitive represents a cuboid missing the top {-y} and left {-x} and right {+x} faces and excludes the top edge of the left {-x} face and all edges of the right {+x} 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. | |||
|- | |||
|- | |||
| '''box3u6.dat''' || '''Cuboid with 3 faces missing 6 edges''' | |||
|- | |||
| [[File:box3u6.png|200px|thumb|alt=Box3u6]] | |||
|| This primitive represents a cuboid missing the top {-y} and left {-x} and right {+x} faces and excludes the top and bottome edges of the right {+x} face and all edges of the left {-x} 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. | |||
|- | |||
|- | |||
| '''box3u7a.dat''' || '''Cuboid with 3 faces missing 7 adjacent edges''' | |||
|- | |||
| [[File:box3u7a.png|200px|thumb|alt=Box3u7a]] | |||
|| This primitive represents a cuboid missing the top {-y} and left {-x} and right {+x} faces and excludes the edges of the missing top (-y) 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. | |||
|- | |||
|- | |||
| '''box3u12.dat''' || '''Cuboid with 3 parallel faces missing all edges''' | |||
|- | |||
| [[File:box3u12.png|200px|thumb|alt=Box3u12]] | |||
|| This primitive represents a cuboid missing the top {-y} and left {-x} and right {+x} faces and excludes all the 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. | |||
|- | |||
|- | |||
| '''box3u8p.dat''' || '''Cuboid with 3 faces missing 8 edges (in two parallel groups)''' | |||
|- | |||
| [[File:box3u8p.png|200px|thumb|alt=Box3u8p]] | |||
|| 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. | |||
|- | |||
|- | |||
| '''box3u10p.dat''' || '''Cuboid with 3 faces in a 'U' shape, missing 10 edges (all except those between the faces)''' | |||
|- | |||
| [[File:box3u10p.png|200px|thumb|alt=Box3u10p]] | |||
|| This primitive represents a cuboid missing the top {-y} and left {-x} and right {+x} faces and excludes all the edges except the two betweenthe 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. | |||
|- | |||
} |
Revision as of 06:00, 28 November 2023
LDraw Primitives Reference
This page is a source of reference for the LDraw primitives in the \LDraw\p directory. Primitives are defined as highly re-usable components of LEGO parts modelled for LDraw. They serve several purposes :
* To speed up parts authoring by providing a library of components which can be incorporated into several parts * To allow rendering software to make substitutions of curved components
Within this reference material the available primitives are categorised into:
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.