LDraw.org Discussion Forums
Minor bfc problem in some parts - Printable Version

+- LDraw.org Discussion Forums (https://forums.ldraw.org)
+-- Forum: Models and Parts (https://forums.ldraw.org/forum-18.html)
+--- Forum: Parts Authoring (https://forums.ldraw.org/forum-19.html)
+--- Thread: Minor bfc problem in some parts (/thread-313.html)



Minor bfc problem in some parts - Roland Melkert - 2011-08-05

Hi all,

I noticed in e.g. 4019.dat lines, like:

0 BFC CERTIFY INVERTNEXT

when investigating a render glitch in my editor, it doesn't expect the CERTIFY token because I was under the impression it's not permitted in this case, confirming:

http://www.ldraw.org/Article415.html

I will loosen the parser, but the library reviewers might want to correct this for the next release.


Re: Minor bfc problem in some parts - Jim DeVona - 2011-08-05

I think you are right to notice this as an exception to the specification - "0 BFC INVERTNEXT" should be sufficient. FWIW, LDView also flags these lines as "CERTIFY command after other BFC" warnings, and seems to figure it out and render as intended.


4019.dat - Steffen - 2011-08-06

4019.dat seems to me to be the only currently official part having this bug.

We took care of many others already, but this one has slipped through.

I'll send that file to Chris for uploading to the PT to let it get fixed.

In your parser, you anyway need a concept of "errors vs. warnings".

For example, when a file lacks its trailing CRLF, you could give up completely,
but that will not be very useful.
Issuing a warning in that case, like a computer language compiler does,
is the right thing to do.

Optionally, you can give your parser an option "treat warnings as errors",
which will harden its warning level.

Thanks for finding that part, which has slipped through!


Re: 4019.dat - Steffen - 2011-08-06

sent that file to Chris for uploading to PT


Re: 4019.dat - Roland Melkert - 2011-08-06

Actually there are some more, if you do a quick grep it will find:

273.dat
30094.dat
3842a.dat
3842b.dat
4019.dat
40378.dat
47405.dat
48724.dat
52036.dat
55423.dat
6574.dat
2739as01.dat
2739bs01.dat
3068as01.dat

I've changed the parser to look at any occurrence of "INVERTNEXT" instead of checking the first token after "BFC" only. It will issue a warning when it's not the first (and only one) now.


My app logs errors and warnings when a recoverable problem is found, like so:

Warning | LDraw file load | C:\Program Files (x86)\ldraw\parts\3702.dat | line 16 | Reference "STUD3A.DAT" case mismatch, should be "stud3a.dat".
Warning | LDraw file load | C:\Program Files (x86)\ldraw\parts\3702.dat | line 18 | Reference "STUD3A.DAT" case mismatch, should be "stud3a.dat".
Warning | LDraw file load | C:\Program Files (x86)\ldraw\parts\3702.dat | line 64 | Reference "2-4cyli.DAT" case mismatch, should be "2-4cyli.dat".
Warning | LDraw file load | C:\Program Files (x86)\ldraw\parts\752.dat | line 29 | Matrix has been corrected due to an invalid determinant.
Warning | LDraw file load | C:\Program Files (x86)\ldraw\parts\752.dat | line 30 | Matrix has been corrected due to an invalid determinant.
Warning | LDraw file load | C:\Program Files (x86)\ldraw\parts\3650a.dat | line 42 | Quad is twisted but could be corrected.
Warning | LDraw file load | C:\Program Files (x86)\ldraw\parts\3650a.dat | line 43 | Quad is twisted but could be corrected.
Warning | render prep | C:\Program Files (x86)\ldraw\parts\3404.dat | Subfile BFC processing canceled due to dependency on subfile without BFC information, caused by "C:\Program Files (x86)\ldraw\p\48\4-4edge.dat". Dual lighting will be used for entire tree.
Warning | render prep | C:\Program Files (x86)\ldraw\parts\3403.dat | Subfile BFC processing canceled due to dependency on subfile without BFC information, caused by "C:\Program Files (x86)\ldraw\p\48\4-4edge.dat". Dual lighting will be used for entire tree.
Error | LDraw file load | C:\Program Files (x86)\ldraw\parts\6252.dat | line 698 | Duplicate point in line definition, line will not be used.
Error | LDraw file load | C:\Program Files (x86)\ldraw\parts\6252.dat | line 699 | Duplicate point in line definition, line will not be used.
Error | LDraw file load | C:\Program Files (x86)\ldraw\parts\6252.dat | line 701 | Multiple duplicate points in quad definition, quad will not be used.
Error | LDraw file load | C:\Program Files (x86)\ldraw\parts\6252.dat | line 702 | Multiple duplicate points in quad definition, quad will not be used.
Warning | LDraw file load | C:\Program Files (x86)\ldraw\parts\2546.dat | line 80 | Quad is not flat, it will be split into two triangles.
Warning | LDraw file load | C:\Program Files (x86)\ldraw\parts\2546.dat | line 81 | Quad is not flat, it will be split into two triangles.


I'm afraid ridding the official library of all warnings might be a huge job, but most are recoverable problems though.


you are right, my error - Steffen - 2011-08-06

You are right.
When posting the above, I had accidentially caught the wrong local folder 8-)
I grepped again and additionally found

S\2739as01.dat
S\2739bs01.dat
S\3068as01.dat

Ironing these glitches out can be done, we already have fixed many other issues in the library.
Examples are:
- erroneous use of plastic color "dark grey" for metal parts
- BFC errors
- syntax errors
etc.

The list of official files which contain BFC CERTIFY INVERTNEXT is fortunately quite short.
Do you want to fix the problems and send the files to Chris for uploading to the PT?


Re: you are right, my error - Roland Melkert - 2011-08-07

Steffen Wrote:
-------------------------------------------------------
> Do you want to fix the problems and send the files
> to Chris for uploading to the PT?

I have never worked with the tracker, just thought of letting the right people know about this misformatting issue.


Re: you are right, my error - Jim DeVona - 2011-08-12

Roland Melkert Wrote:
-------------------------------------------------------
> Steffen Wrote:
> --------------------------------------------------
> -----
> > Do you want to fix the problems and send the
> files
> > to Chris for uploading to the PT?
>
> I have never worked with the tracker, just thought
> of letting the right people know about this
> misformatting issue.

I can make these fixes and submit them to Chris [Dee?] unless either of you are already on it - are you?


Re: you are right, my error - Roland Melkert - 2011-08-12

Jim DeVona Wrote:
> I can make these fixes and submit them to Chris
> unless either of you are already on it - are you?

I'm not, so feel free to submit corrections.