Primitives Reference: Difference between revisions
(Updated ring prims up to r=11) |
(Updated all regular resolution ring prims) |
||
Line 470: | Line 470: | ||
r=11 : 1-16ring11, 1-8ring11, 3-16ring11, 1-4rin11, 7-16ring11, 2-4rin11, 4-4rin11<br> | r=11 : 1-16ring11, 1-8ring11, 3-16ring11, 1-4rin11, 7-16ring11, 2-4rin11, 4-4rin11<br> | ||
r=12 : 1-8ring12, 3-16ring12, 1-4rin12, 5-16ring12, 3-8rin12, 2-4rin12, 7-8rin12, 4-4rin12<br> | r=12 : 1-8ring12, 3-16ring12, 1-4rin12, 5-16ring12, 3-8rin12, 2-4rin12, 7-8rin12, 4-4rin12<br> | ||
r=13 : 3-16ring13, 1-4rin13, 3-8rin13, 2-4rin13, 4-4rin13<br> | r=13 : 1-8ring13, 3-16ring13, 1-4rin13, 5-16ring13, 3-8rin13, 2-4rin13, 4-4rin13<br> | ||
r=14 : 3-16ring14, 1-4rin14, 2-4rin14, 3-4rin14, 4-4rin14<br> | r=14 : 3-16ring14, 1-4rin14, 2-4rin14, 3-4rin14, 4-4rin14<br> | ||
r=15 : 1-8rin15, 1-4rin15, 3-8rin15, 2-4rin15, 7-8rin15, 4-4rin15<br> | r=15 : 1-8rin15, 3-16ring15, 1-4rin15, 3-8rin15, 2-4rin15, 7-8rin15, 4-4rin15<br> | ||
r=16 : 1-4rin16, 3-8rin16, 2-4rin16, 7-8rin16, 4-4rin16<br> | r=16 : 1-8ring16, 1-4rin16, 3-8rin16, 2-4rin16, 3-4ring16, 7-8rin16, 4-4rin16<br> | ||
r=17 : 1-8rin17, 1-4rin17, 7-16ring17, 2-4rin17, 4-4rin17<br> | r=17 : 1-8rin17, 1-4rin17, 5-16ring17, 3-8ring17, 7-16ring17, 2-4rin17, 4-4rin17<br> | ||
r=18 : 1-8rin18, 1-4rin18, 3-8rin18, 2-4rin18, 4-4rin18<br> | r=18 : 1-16ring18, 1-8rin18, 1-4rin18, 3-8rin18, 2-4rin18, 4-4rin18<br> | ||
r=19 : 1-16ring19, 1-8rin19, 1-4rin19, 2-4ring19, 4-4rin19<br> | r=19 : 1-16ring19, 1-8rin19, 3-16ring19, 1-4rin19, 3-8ring19, 2-4ring19, 3-4ring19, 4-4rin19<br> | ||
r=20 : 1-4rin20, 4-4rin20<br> | r=20 : 1-4rin20, 2-4rin20, 4-4rin20<br> | ||
r=21 : 4-4rin21<br> | r=21 : 1-4ring21, 3-8ring21, 4-4rin21<br> | ||
r=22 : 2-4rin22, 3-4rin22, 4-4rin22<br> | r=22 : 1-16ring22, 3-16ring22, 2-4rin22, 3-4rin22, 4-4rin22<br> | ||
r=23 : 1-8rin23, 1-4rin23, 2-4rin23, 4-4rin23<br> | r=23 : 1-16ring23, 1-8rin23, 1-4rin23, 2-4rin23, 4-4rin23<br> | ||
r=24 : 3-16ring24, 1-4rin24, 3-8rin24, 2-4rin24, 4-4rin24<br> | r=24 : 1-16ring24, 3-16ring24, 1-4rin24, 3-8rin24, 2-4rin24, 4-4rin24<br> | ||
r=25 : 2-4rin25, 4-4rin25<br> | r=25 : 1-4ring25, 2-4rin25, 4-4rin25<br> | ||
r=26 : 4-4rin26<br> | r=26 : 1-4ring26, 2-4ring26, 4-4rin26<br> | ||
r=27 : 1-4ring27<br> | r=27 : 1-8ring27, 4-4ring27<br> | ||
r=28 : 1-4rin28<br> | r=28 : 1-8ring28, 1-4rin28, 2-4ring28, 4-4ring28<br> | ||
r=29 : 4-4rin29<br> | r=29 : 1-4ring29, 3-8ring29, 2-4ring29, 3-4ring29, 4-4rin29<br> | ||
r=30 : 2-4rin30, 4-4rin30<br> | r=30 : 2-4rin30, 4-4rin30<br> | ||
r=31 : 4-4rin31<br> | r=31 : 2-4ring31, 4-4rin31<br> | ||
r=32 : 4-4rin32<br> | r=32 : 1-8ring32, 2-4ring32, 4-4rin32<br> | ||
r=33 : 4-4rin33<br> | r=33 : 1-8ring33, 1-4ring33, 4-4rin33<br> | ||
r=34 : 1-4rin34, 4-4rin34<br> | r=34 : 1-8ring34, 1-4rin34, 4-4rin34<br> | ||
r=36 : 4-4rin36<br> | r=35 : 1-8ring35, 4-4ring35<br> | ||
r=37 : 2-4ring37, 4-4rin37<br> | r=36 : 1-4ring36, 4-4rin36<br> | ||
r=37 : 3-8ring37, 2-4ring37, 4-4rin37<br> | |||
r=38 : 1-4rin38, 4-4rin38<br> | r=38 : 1-4rin38, 4-4rin38<br> | ||
r=39 : 1-8rin39, 1-4rin39, 7-8rin39, 4-4rin39<br> | r=39 : 1-16ring39, 1-8rin39, 3-16ring39, 1-4rin39, 7-8rin39, 4-4rin39<br> | ||
r=40 : 7-8rin40, 4-4rin40<br> | r=40 : 1-4ring40, 7-8rin40, 4-4rin40<br> | ||
r=41 : 4-4ring41<br> | |||
r=42 : 2-4ring42<br> | |||
r=43 : 2-4ring43, 4-4rin43<br> | r=43 : 2-4ring43, 4-4rin43<br> | ||
r=44 : 2-4ring44, 4-4rin44<br> | r=44 : 2-4ring44, 4-4rin44<br> | ||
r=45 : 4-4rin45<br> | r=45 : 2-4ring45, 4-4rin45<br> | ||
r=46 : 4-4rin46<br> | r=46 : 2-4ring46, 4-4rin46<br> | ||
r=47 : 4-4rin47<br> | r=47 : 4-4rin47<br> | ||
r=48 : 1-4rin48, 4-4rin48<br> | r=48 : 1-4rin48, 4-4rin48<br> | ||
r=49 : 1-4rin49<br> | r=49 : 1-4rin49, 4-4ring49<br> | ||
r=50 : 1-4rin50, 4-4rin50<br> | r=50 : 1-4rin50, 4-4rin50<br> | ||
r=51 : 4-4rin51<br> | r=51 : 4-4rin51<br> | ||
r=52 : 2-4rin52, 4-4rin52<br> | r=52 : 2-4rin52, 4-4rin52<br> | ||
r=57 : 4-4rin57<br> | r=53 : 3-16ring53<br> | ||
r=55 : 2-4ring55<br> | |||
r=57 : 1-16ring57, 1-4ring57, 4-4rin57<br> | |||
r=61 : 4-4ring61<br> | |||
r=66 : 1-4ring66, 4-4ring66<br> | |||
r=67 : 1-4ring67<br> | |||
r=68 : 4-4ring68<br> | |||
r=70 : 1-16ring70, 1-8ring70, 3-16ring70, 2-4ring70, 4-4ring70<br> | |||
r=71 : 4-4ring71<br> | |||
r=77 : 4-4rin77<br> | r=77 : 4-4rin77<br> | ||
r=78 : 4-4rin78<br> | r=78 : 4-4rin78<br> | ||
r=79 : 1-4ring79, 4-4rin79<br> | r=79 : 1-4ring79, 4-4rin79<br> | ||
r=80 : 3-16ring80<br> | |||
r=81 : 4-4ring81<br> | |||
r=85 : 4-4rin85<br> | r=85 : 4-4rin85<br> | ||
r=88 : 4-4ring88<br> | |||
r=95 : 4-4ring95<br> | |||
r=97 : 4-4ring97<br> | |||
r=101 : 4-4ring101<br> | r=101 : 4-4ring101<br> | ||
<br> | <br> |
Revision as of 21:53, 30 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.
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}.
To avoid rounding errors, it is preferable to use existing fractional circular primitives, or create a new primitive, rather than rotate an existing primitive by anything other than 90 or 180 degrees. For example, use 3-16XXXX.dat rather than combining 1-8XXXX.dat with 1-16XXXX.dat rotated by 22.5 degreees.
To avoid matrix arithmetic problems in some renderers, the third dimension ({y} in the default orientation) of two-dimensional primitives must be given a non-zero scaling factor. LDraw circles are normally formed of 16-sided polygons (hexdecagons) - the regular resolution. For larger elements, where scaling-up of hexadecagons would give too angular an appearance, a series of high resolution primitives based on a 48-sided polygon are available. These may also be used for parts not well suited to a 16-fold symmetry.
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 radius 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