Use of leading space for numbers

From LDraw.org Wiki
Revision as of 19:15, 25 June 2011 by Mikeheide (talk | contribs)
Jump to navigation Jump to search

The reason for using leading space in front of numbers lower than ten (10) is the sort order in listings.
Example: (wrong order)
Brick 10 x 10
Brick 2 x 2
These two description would be in a list just the wrong way because the seventh character (as it is the first different) will decide about the sort order.
So if we add a whitespace in front of the 2 we have "whitespace" and "1" at the seventh character. Because the "whitespace" has a lower internal value as the "1" the correct sorting order will be visible.
To show it visually here I had to substitude the whitespace by underscore.
Example: (correct order)
Brick__2_x__2
Brick_10_x_10

As this has not been considered from the beginning of the library there are little inconsistances in the library.
I like to mention here what I had discovered so far that does not follow the simple rule - "If number is used and number is lower than 10 use a second whitespace in front of that number":
at parts and subparts

  • if the word 'type' is the last word before that number (Baseplate 32 x 32 Road 9-Stud Landing Pad Type 1 (Orange) - [1])
  • if the word 'Road' is the last word before that number and the letters '-Studs' are direct attached to the number (Baseplate 32 x 32 Road 9-Stud Landing Pad Type 1 (Orange) - [2])

My earlier resumee at this place has been wrong. The real old part with L, V, H and / direct after the number do have a leading whitespace. And that makes sense to me because of the sort order.(2011-06-25)

at primitives

  • if word 'Torus' is in the description only the first of the numbers needs a leading whitespace
  • if word 'Circle' is in the description none of the numbers needs a leading whitespace
  • if word 'Cylinder' is in the description none of the numbers needs a leading whitespace
  • if word 'Cone' is in the description only the first of the numbers needs a leading whitespace
  • if word 'Ring' is in the description only the first of the numbers needs a leading whitespace
  • if word 'Disc' is in the description none of the numbers needs a leading whitespace
  • if word 'Chord' is in the description none of the numbers needs a leading whitespace

If you have an original part that does not fit into this scheme please inform us. Please do not use the parts on the PT as reference because there are parts that follow not these rules maybe because of the usage of DATHeader.
To bring DATHeader in a good condition I like to have this cleared if possible.
The soon coming version 3.0.8.0 of DATHeader will act as described here but without a correct check on the primitives.

--Mikeheide 16:32, 24 June 2011 (EDT)