Use of leading space for numbers: Difference between revisions

From LDraw.org Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 14: Line 14:
</font>
</font>


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:<br />
As this has not been considered from the beginning of the library there are little inconsistances in the library.<br />
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":<br />
'''at parts and subparts'''<br />
* if the word 'type' is the last word before that number (Baseplate 32 x 32 Road 9-Stud Landing Pad Type 1 (Orange) - [http://www.ldraw.org/library/official/parts/6099p04.dat])
* if the word 'type' is the last word before that number (Baseplate 32 x 32 Road 9-Stud Landing Pad Type 1 (Orange) - [http://www.ldraw.org/library/official/parts/6099p04.dat])
* if the letter 'V' is direct attached to the number (Electric 9V Battery Box  4 x 14 x  4 (Complete Shortcut) - [http://www.ldraw.org/library/official/parts/2847c01.dat])
* if the letter 'V' is direct attached to the number (Electric 9V Battery Box  4 x 14 x  4 (Complete Shortcut) - [http://www.ldraw.org/library/official/parts/2847c01.dat])
Line 20: Line 22:
* 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) - [http://www.ldraw.org/library/official/parts/6099p04.dat])
* 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) - [http://www.ldraw.org/library/official/parts/6099p04.dat])


Now that I have had a deeper look to this I feel that it is at present much easier than I thought. As soon as the number is directly (without whitespace) followed by an letter there is no additional whitespace in front of the number.
Now that I have had a deeper look to this I feel that it is at present much easier than I thought. As soon as the number is directly (without whitespace) followed by an letter there is no additional whitespace in front of the number.<br />


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.
'''at primitives'''<br />
* 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. <br />
To bring DATHeader in a good condition I like to have this cleared if possible.


--[[User:Mikeheide|Mikeheide]] 16:32, 24 June 2011 (EDT)
--[[User:Mikeheide|Mikeheide]] 16:32, 24 June 2011 (EDT)

Revision as of 21:54, 24 June 2011

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 letter 'V' is direct attached to the number (Electric 9V Battery Box 4 x 14 x 4 (Complete Shortcut) - [2])
  • if the letter 'L' is direct attached to the number (Bar 3L - [3])
  • 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) - [4])

Now that I have had a deeper look to this I feel that it is at present much easier than I thought. As soon as the number is directly (without whitespace) followed by an letter there is no additional whitespace in front of the number.

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.

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