Sanitizing quad errors

Sanitizing quad errors
(this is nost strictly about specifications, so feel free to move this thread)

So, there are some parts in the library that contains errors of various nature. Some of them must be solved by hand, others should be easy to solve "en mass" with minimal work. The problem about crossed quads is an example. Many viewer have built-in correction code, which made the problem more hidden and probably made it easier for mistakes to slip in the library. I think there's no reason not to address the issue directly on the library, so i suggest this:

- find a routine that correct quads. I'm sure there are many, for example it can be inferred from this post that some detection & correction tool already exists. In LDView the code looks like in here.
- put it into a programs that scans all .dat file in the library searching for quad lines. Pass the vertex to che correction function and eventually update the line. If the file has corrections, overwrite the original one with the correct one, maybe reporting which files have been modified for later review. The program appears to be simple as it operates on single lines, it doesn't need any context whatsoever on the 3d model beside the single quad. Actually it's mostly opening and rewriting files.
- review the modified files. I guess there are not that many, so we can probably manually verify one by one
- commit all changed files to the official library. I don't know how it is stored and who has access to it, but i don't think there are problems in a "mass commit", or are there?
- either forget about the script or somehow schedule it to run on new parts/periodically to detect new error.

Of course this doesn't break any compatibility, updating the library will have no visible difference in already existing software.

I'm no good in C, so i'm not able to help with the code (unless you want it written in other languages), i can offer my help to review corrected parts, if it's needed.
Re: Sanitizing quad errors
"Bowtie" quad are not currently allowed by spec (but it wasn't always this way). I wrote a program a long time ago to bulk fix the outstanding issues but I'm not sure if I have the source any more. I do, however, still have my error fix library and making a new program would be fairly trivial.
Re: Sanitizing quad errors
Those corrections in the brickset thread you mention are from LDCad's logfile.

With LDCad I actually correct the LDraw lines in memory, they are just never written. Maybe it could be useful if I made that possible?

Correcting many errors (bowties, matrix with zeros in a single row, case mismatches, etc) in the current library would then be possible by just loading a dummy ldr in LDCAd containing references to every file in the parts folder followed by a special save command.

Will be a nice stress test too, might need the 64bit version memory wise.
« Next Oldest | Next Newest »

Forum Jump:

Users browsing this thread: 1 Guest(s)