Primitives Reference: Difference between revisions
GeraldLasser (talk | contribs) |
(Updated all high resolution ring prims) |
||
Line 542: | Line 542: | ||
r=10 : 1-24ring10, 1-16ring10, 1-12ring10, 5-48ring10, 1-8ring10, 7-48ring10, 1-6ring10, 5-24ring10, 1-4rin10, 2-4ring10, 4-4rin10<br> | r=10 : 1-24ring10, 1-16ring10, 1-12ring10, 5-48ring10, 1-8ring10, 7-48ring10, 1-6ring10, 5-24ring10, 1-4rin10, 2-4ring10, 4-4rin10<br> | ||
r=11 : 1-24ring11, 1-16ring11, 1-8ring11, 7-48ring11, 3-16ring11, 1-4rin11, 7-16ring11, 2-4rin11, 4-4rin11<br> | r=11 : 1-24ring11, 1-16ring11, 1-8ring11, 7-48ring11, 3-16ring11, 1-4rin11, 7-16ring11, 2-4rin11, 4-4rin11<br> | ||
r=12 : 1-12ring12, 1-4ring12, 1-6rin12, 2-4rin12, 4-4rin12<br> | r=12 : 1-12ring12, 1-8ring12, 1-4ring12, 1-6rin12, 2-4rin12, 4-4rin12<br> | ||
r=13 : 1-16ring13, 1-6rin13, 5-24ring13, 1-4rin13, 5-12ring13, 11-24ring13, 3-4rin13, 4-4rin13<br> | r=13 : 1-16ring13, 1-12ring13, 1-8ring13, 1-6rin13, 5-24ring13, 1-4rin13, 5-12ring13, 11-24ring13, 3-4rin13, 4-4rin13<br> | ||
r=14 : 1-16ring14, 1-8rin14, 1-6rin14, 5-12ring14, 3-4rin14, 4-4rin14<br> | r=14 : 1-24ring14, 1-16ring14, 1-12ring14, 1-8rin14, 1-6rin14, 3-16ring14, 1-4rin14, 3-8ring14, 5-12ring14, 3-4rin14, 4-4rin14<br> | ||
r=15 : 1-12ring15, 1-4rin15, 4-4rin15<br> | r=15 : 1-48ring15, 1-24ring15, 1-16ring15, 1-12ring15, 1-8ring15, 1-6ring15, 3-16ring15, 5-24ring15, 1-4rin15, 2-4ring15, 4-4rin15<br> | ||
r=16 : 1-8rin16, 1-6rin16, 1-4rin16, 7-16ring16, 2-4rin16, 3-4rin16, 5-6rin16, 4-4rin16<br> | r=16 : 1-16ring16, 1-8rin16, 7-48ring16, 1-6rin16, 1-4rin16, 7-16ring16, 2-4rin16, 3-4rin16, 5-6rin16, 4-4rin16<br> | ||
r=17 : 1-12ring17, 1-6rin17, 5-24ring17, 1-4rin17, 1-3rin17, 2-4rin17, 4-4rin17<br> | r=17 : 1-16ring17, 1-12ring17, 1-6rin17, 5-24ring17, 1-4rin17, 1-3rin17, 2-4rin17, 4-4rin17<br> | ||
r=18 : 1-6rin18, 5-24ring18, 4-4rin18<br> | r=18 : 1-16ring18, 7-48ring18, 1-6rin18, 5-24ring18, 1-4rin18, 4-4rin18<br> | ||
r=19 : 1-24ring19, 1-16ring19, 1-6rin19, 11-48ring19, 1-4rin19, 2-4rin19, 4-4rin19<br> | r=19 : 1-24ring19, 1-16ring19, 1-12ring19, 5-48ring19, 1-8ring19, 1-6rin19, 11-48ring19, 1-4rin19, 2-4rin19, 4-4rin19<br> | ||
r=20 : 1-12ring20, 1-8rin20, 5-24ring20, 1-4rin20, 4-4rin20<br> | r=20 : 1-12ring20, 1-8rin20, 5-24ring20, 11-48ring20, 1-4rin20, 4-4rin20<br> | ||
r=21 : 1-16ring21, 1-4rin21, 4-4rin21<br> | r=21 : 1-16ring21, 11-48ring21, 1-4rin21, 4-4rin21<br> | ||
r=22 : 1-4rin22, 4-4rin22<br> | r=22 : 1-12ring22, 11-48ring22, 1-4rin22, 4-4rin22<br> | ||
r=23 : 1-4rin23<br> | r=23 : 1-4rin23<br> | ||
r=24 : 5-24ring24, 1-4rin24, 4-4rin24<br> | r=24 : 1-24ring24, 1-12ring24, 5-24ring24, 1-4rin24, 4-4rin24<br> | ||
r=25 : 1-4rin25, 4-4rin25<br> | r=25 : 3-16ring25, 1-4rin25, 4-4rin25<br> | ||
r=26 : 1-4rin26, 4-4rin26<br> | r=26 : 1-4rin26, 4-4rin26<br> | ||
r=27 : 1-4rin27, 4-4rin27<br> | r=27 : 1-4rin27, 4-4rin27<br> | ||
r=28 : 1-8rin28, 5-24ring28, 4-4rin28<br> | r=28 : 1-8rin28, 5-24ring28, 11-48ring28, 1-4ring28, 4-4rin28<br> | ||
r=29 : 1-24ring29, 1-16ring29, 1-12ring29, 1-6ring29, 1-4rin29, 5-24ring29, 4-4rin29<br> | r=29 : 1-24ring29, 1-16ring29, 1-12ring29, 5-48ring29, 7-48ring29, 1-6ring29, 3-16ring29, 11-48ring29, 1-4rin29, 5-24ring29, 4-4rin29<br> | ||
r=30 : 1-4rin30, 4-4rin30<br> | r=30 : 1-24ring30, 1-16ring30, 1-4rin30, 3-8ring30, 4-4rin30<br> | ||
r=31 : 1-4rin31, 2-4rin31<br> | r=31 : 1-4rin31, 2-4rin31<br> | ||
r=32 : 1-4rin32, | r=32 : 5-48ring32, 1-4rin32, 2-4ring32<br> | ||
r=33 : 1-4rin33, 4-4rin33<br> | r=33 : 5-24ring33, 1-4rin33, 4-4rin33<br> | ||
r=34 : 1-4rin34, 4-4rin34<br> | r=34 : 7-48ring34, 5-24ring34, 11-48ring34, 1-4rin34, 2-4ring34, 4-4rin34<br> | ||
r=35 : 1-8rin35, 5-24ring35, 1-4rin35, 4-4ring35<br> | r=35 : 1-24ring35, 1-16ring35, 1-8rin35, 5-24ring35, 1-4rin35, 4-4ring35<br> | ||
r=36 : 1-4rin36<br> | r=36 : 1-8ring36, 1-4rin36, 1-3ring36, 4-4ring36<br> | ||
r=37 : 1-4rin37, 2-4ring37, 4-4rin37<br> | r=37 : 1-8ring37, 1-4rin37, 2-4ring37, 4-4rin37<br> | ||
r=38 : 1-12ring38<br> | r=38 : 1-12ring38, 1-6ring38, 1-4rin38, 4-4ring38<br> | ||
r=39 : 1-24ring39, 1-12ring39, 1-8rin39, 1-6ring39, 3-16ring39, 1-4rin39, 4-4ring39<br> | r=39 : 1-24ring39, 1-16ring39, 1-12ring39, 5-48ring39, 1-8rin39, 7-48ring39, 1-6ring39, 3-16ring39, 1-4rin39, 2-4ring39, 4-4ring39<br> | ||
r=40 : 1-4rin40, 11-48ring40, 2-4ring40<br> | r=40 : 1-4rin40, 11-48ring40, 2-4ring40<br> | ||
r=41 : 1-4rin41, 4-4rin41<br> | r=41 : 1-8ring41, 1-4rin41, 4-4rin41<br> | ||
r=42 : 1-12ring42, 1-6ring42, 4-4rin42<br> | r=42 : 1-12ring42, 1-6ring42, 4-4rin42<br> | ||
r=43 : 1-48ring43, 1-16ring43, 1-6ring43, 4-4ring43<br> | r=43 : 1-48ring43, 1-16ring43, 1-12ring43, 1-6ring43, 4-4ring43<br> | ||
r=44 : 4-4ring44<br> | r=44 : 4-4ring44<br> | ||
r=45 : 1-4rin45<br> | r=45 : 1-4rin45, 4-4ring45<br> | ||
r=47 : 1-6rin47, 4-4rin47<br> | r=46 : 1-4ring46<br> | ||
r=48 : 1-4rin48<br> | r=47 : 1-6rin47, 1-4ring47, 4-4rin47<br> | ||
r=49 : 4-4rin49<br> | r=48 : 7-48ring48, 1-4rin48, 2-4ring48<br> | ||
r=50 : 1-6rin50, 4-4rin50<br> | r=49 : 1-24ring49, 1-16ring49, 1-4ring49, 4-4rin49<br> | ||
r=50 : 1-6rin50, 3-16ring50, 4-4rin50<br> | |||
r=51 : 1-4rin51<br> | r=51 : 1-4rin51<br> | ||
r=52 : 11-24ring52, 4-4rin52<br> | r=52 : 11-24ring52, 4-4rin52<br> | ||
r=53 : 4-4rin53<br> | r=53 : 1-8ring53, 3-16ring53, 4-4rin53<br> | ||
r=54 : 4-4rin54<br> | r=54 : 4-4rin54<br> | ||
r=56 : 1-8rin56<br> | r=55 : 2-4ring55<br> | ||
r=56 : 1-12ring56, 1-8rin56<br> | |||
r=57 : 1-4ring57, 4-4ring57<br> | |||
r=59 : 1-24ring59, 1-16ring59, 1-12ring59<br> | |||
r=60 : 1-24ring60, 1-16ring60<br> | r=60 : 1-24ring60, 1-16ring60<br> | ||
r=63 : 1-4rin63<br> | r=63 : 1-4rin63<br> | ||
r=64 : 1-4rin64<br> | r=64 : 1-4rin64<br> | ||
r=65 : 1-4rin65<br> | r=65 : 1-4rin65<br> | ||
r=69 : 5-24ring69<br> | |||
r=70 : 1-4rin70<br> | r=70 : 1-4rin70<br> | ||
r=71 : 1-4rin71, 4-4ring71<br> | r=71 : 1-4rin71, 4-4ring71<br> | ||
r=77 : 4-4ring77<br> | |||
r=78 : 1-12ring78<br> | r=78 : 1-12ring78<br> | ||
r=79 : 1-4ring79<br> | |||
r=80 : 7-48ring80, 1-6ring80<br> | r=80 : 7-48ring80, 1-6ring80<br> | ||
r=81 : 4-4ring81<br> | |||
r=82 : 1-4rin82<br> | r=82 : 1-4rin82<br> | ||
r=83 : 1-4rin83<br> | r=83 : 1-4rin83<br> | ||
r=84 : 1-8ring84<br> | |||
r=85 : 4-4ring85<br> | |||
r=88 : 4-4ring88<br> | |||
r=90 : 11-48ring90<br> | |||
r=95 : 2-4ring95<br> | |||
r=96 : 1-4ring96<br> | |||
r=97 : 4-4rin97<br> | r=97 : 4-4rin97<br> | ||
r=99 : 1-6ring99, 4-4ring99<br> | r=99 : 1-6ring99, 4-4ring99<br> | ||
r=100 : 4-4ring100<br> | r=100 : 1-24ring100, 4-4ring100<br> | ||
r=130 : 4-4ring130<br> | |||
r=160 : 2-4ring160<br> | |||
r=179 : 1-4ring179<br> | r=179 : 1-4ring179<br> | ||
r=240 : 2-4ring240<br> | r=240 : 2-4ring240<br> |
Revision as of 09:19, 1 December 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