LDraw.org Discussion Forums

Full Version: Auto correcting (some) defects in the official library
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6
Like mentioned in some of the other threads, the current official library suffers from a number of defects which can be corrected automatically but can be somewhat of a pain to new software trying to use the library.

It also has been suggested many times most of these errors can be fixed using an automated process.

So I did a quick hack in the LDCad 1.4 code to make it possible to save corrected .dat files back to disk, this resulted in about 116 corrected .dat files.

Only downside I noticed is the loss of some indenting (only for the corrected lines, as LDCad preserves unmodified line content).

I also noticed some minor mixed dos/unix line endings which are indirectly auto corrected for any file that needed rewriting.

This test includes only 'hour glass quad' corrections, but with some additional tweaks I can also auto correct:

case mismatches
non flat triangles
quad with duplicate point (degrade to triangle)
all zero row or col ref matrix
type 5 line with missing or duplicate control points (degrade to normal line)


Should I continue my tweaks, and compile a patch containing all changed files so someone else can double check and merge them into the part tracker?

If so which corrections are actually wanted, and or which additional correction would be needed/wanted.

ps: this topic might be better off in the part authoring forum, not really sure though, admins feel free to move it.
Yes this would be great. Fixes to official parts need to be sent to parts@ldraw.org. They need to go through the Parts Tracker, where the changes can be reviewed.

Of your suggested additional tweaks, I'm not sure about "type 5 line with missing or duplicate control points (degrade to normal line)"
Quote:non flat triangles
I guess you mean quads? ;D
-> gives 2 triangle + 1 condline?
I should probably have a look into DATHeader body autocorrection procedure. I am sure there are some more of this stuff.

Please remember these are only the body corrections!
1) RGB value to uppercase corrected.
2) ~Moved to file references corrected.
3) 0 WRITE corrected.
4) 0 ROTATION deleted.
5) 0 BFC CERTIFY INVERTNEXT corrected.
6) 0 BFC INVERTNEXT not followed by linetype 1 corrected.
7) Unnecessary '0 BFC INVERTNEXT' corrected.
8) Flat subfile scaled in flat direction corrected
9) 0 COLOR deleted.
10) Double lines are deleted.
11) Bow-tie quads corrected. Winding?
12) Warped quads splitted into triangles.
13) Concave quads splitted into triangles.
14) Use of only '0' for comments corrected.
15) Matrix all zero – corrected.
16) Identical vertices - tried to correct. Please check again.
17) Incorrect color for linetype - corrected

If you need more details for the points, please just ask. I think most of them are self explaining.
18) Color code in LDConfig (but true color are valid)
Maybe without understanding all the details here, IMO we don't need another tool to fix all these issues.
We need more human hands and eyes that are willing to start working on all the problem files.

Everybody seams to think these issues is going to be fixed programatically. I doubt it.
Tools are a good help, but if no one starts working with them, the errors will always be there.

What errors could LDCad fix, except those that DatHeader already fixes?
"We need more human hands and eyes that are willing to start working on all the problem files." - That's why i never coded DATHeader for automatic process. There is always a human eye needed Smile.
Quote:What errors could LDCad fix, except those that DatHeader already fixes?
Looking at the list Michael gave none Smile Did not realize datheader also fixed mesh problems (given it's name).

Only difference is the batch approach as I can load the entire official LDraw library and write all corrected files back to disk afterwards in one go.

Quote:IMO we don't need another tool to fix all these issues.
I'm not creating a new tool for this, LDCad does these fixes during loading anyway I just tweaked some things to let it save all those modified files.

But you are both right it's only useful if anyone is willing to double check the resulting changed files (probably about 200 or so).

Although I'm wondering do things like bow ties really have to go though the full review stage? Isn't it easier to just look at the differences text wise combined with a quick LDView checkup.

It's just to get rid of some of the more annoying errors not to get those parts up to modern standards etc (as most of them also have bigger authoring problems like missing invalid/bfc less then perfect conditional lines etc).

Anyway I'll finish my tweaks and leave the result for anyone willing (or not) to pick it up.
Philippe Hurbain Wrote:I guess you mean quads? ;D
-> gives 2 triangle + 1 condline?
Yes, although it doesn't add the conline at the moment as it's only a fallback.

What's a normal minimal angle for splitting a quad anyway, I noticed for example 30378 has very weird quads (bow tie and non flat). Jet it seems LDView keeps them as quads anyway.

[attachment=1391]

This (newer improved) version of my quad fixer uses ~18 deg (max 0.05 dotprod diff), but I'm wondering if it should be even lower.
Yes it should. According to spec, 3° is the maximum non-coplanarity.
Pages: 1 2 3 4 5 6