Roland Melkert Wrote:
>
> I've got it working now without the need for
> header information, but it's still guessing and so
> it can guess wrong, like for example the
> town0-1.ldr has this line:
>
> 1 7 540 0 -800 0 0 0.50 0 0.50 0 -0.50 0 0
> baihous1.ldr
>
> The whole house is scaled down (to datsville scale
> I guess?). This will cause my 'improved' guessing
> code to handle the whole town0-1.ldr as a single
> part. But it can be corrected by fixing the header
> of town0-1.ldr only instead of all the boxed
> parts.
>
For a human, the line:
0 Unofficial Datsville Town Sub-Model
says it all, but I understand it's a bit harder to make software with logic fuzzy enough to understand it.
If a header line contains the string "official" (disregard upper/lowercase), that line probably a part/model/primitive identifier.
- If one header line contains both "official" and "model" (disregard upper/lowercase), it's a model.
- If one header line contains both "official" and "part" - but not "sub-part"! (disregard upper/lowercase), it's a part.
If a file contains type 1 references to .LDR files, it's a model.
If a file contains references to parts, it's most likely a model.
If a file contains several line type 2 - 5 and references to primitives, it's likely a part.
But I also understand that if a program has to evaluate a lot of part files with this fuzzy logic, it takes more processing than it should have had to. I think I'll soon get back with a suggestion of a better alternative to that !LDraw_org meta-statement...
/Tore
(I've changed my mind about "If a file is located in the Parts folder...", since there are lots of shortcuts, like mc with rider, that have to be treated as models, not parts.)
>
> I've got it working now without the need for
> header information, but it's still guessing and so
> it can guess wrong, like for example the
> town0-1.ldr has this line:
>
> 1 7 540 0 -800 0 0 0.50 0 0.50 0 -0.50 0 0
> baihous1.ldr
>
> The whole house is scaled down (to datsville scale
> I guess?). This will cause my 'improved' guessing
> code to handle the whole town0-1.ldr as a single
> part. But it can be corrected by fixing the header
> of town0-1.ldr only instead of all the boxed
> parts.
>
For a human, the line:
0 Unofficial Datsville Town Sub-Model
says it all, but I understand it's a bit harder to make software with logic fuzzy enough to understand it.
If a header line contains the string "official" (disregard upper/lowercase), that line probably a part/model/primitive identifier.
- If one header line contains both "official" and "model" (disregard upper/lowercase), it's a model.
- If one header line contains both "official" and "part" - but not "sub-part"! (disregard upper/lowercase), it's a part.
If a file contains type 1 references to .LDR files, it's a model.
If a file contains references to parts, it's most likely a model.
If a file contains several line type 2 - 5 and references to primitives, it's likely a part.
But I also understand that if a program has to evaluate a lot of part files with this fuzzy logic, it takes more processing than it should have had to. I think I'll soon get back with a suggestion of a better alternative to that !LDraw_org meta-statement...
/Tore
(I've changed my mind about "If a file is located in the Parts folder...", since there are lots of shortcuts, like mc with rider, that have to be treated as models, not parts.)