LDraw.org Discussion Forums
BFC and parts - Printable Version

+- LDraw.org Discussion Forums (https://forums.ldraw.org)
+-- Forum: LDraw Programs (https://forums.ldraw.org/forum-7.html)
+--- Forum: LDraw Editors and Viewers (https://forums.ldraw.org/forum-11.html)
+--- Thread: BFC and parts (/thread-23549.html)



BFC and parts - Michael Horvath - 2019-07-10

Is there a tutorial on how to fix/add BFC in parts? E.g. tools to use, workflow, etc.


RE: BFC and parts - Orion Pobursky - 2019-07-10

(2019-07-10, 22:37)Michael Horvath Wrote: Is there a tutorial on how to fix/add BFC in parts? E.g. tools to use, workflow, etc.

Not really. It's super easy:

- Add BFC CERTIFY CCW per the header spec
- Open the part in LDView
- In Preferences -> BFC, check the "green front faces" and "red back faces" options and click apply
- Look for any red
- If it's a tri/quad, reverse the winding
- If it's flat primitive, flip it 180
- If it's a non-flat primitive, put BFC INVERTNEXT before it
- Continue until there is no red


RE: BFC and parts - Travis Cobbs - 2019-07-11

(2019-07-10, 23:36)Orion Pobursky Wrote: Not really. It's super easy:

- Add BFC CERTIFY CCW per the header spec
- Open the part in LDView
- In Preferences -> BFC, check the "green front faces" and "red back faces" options and click apply
- Look for any red
- If it's a tri/quad, reverse the winding
- If it's flat primitive, flip it 180
- If it's a non-flat primitive, put BFC INVERTNEXT before it
- Continue until there is no red

If after step 1 the part is all (or mostly) red, you might want to change the BFC CERTIFY CCW to BFC CERTIFY CW instead of having to edit everything. Also, if you enable blue neutral faces in LDView, faces that aren't being culled will show in blue. There are valid reasons for blue faces, but they are relatively rare.


RE: BFC and parts - Orion Pobursky - 2019-07-11

(2019-07-11, 2:12)Travis Cobbs Wrote: If after step 1 the part is all (or mostly) red, you might want to change the BFC CERTIFY CCW to BFC CERTIFY CW instead of having to edit everything. Also, if you enable blue neutral faces in LDView, faces that aren't being culled will show in blue. There are valid reasons for blue faces, but they are relatively rare.

The library standards state that all new or updated parts should be CCW.


RE: BFC and parts - Travis Cobbs - 2019-07-12

(2019-07-11, 2:15)Orion Pobursky Wrote: The library standards state that all new or updated parts should be CCW.

Where do they say that? The File Format Restrictions for the Official Library document specifically allows both CW and CCW. If the opposite is indicated somewhere else, then one of the documents needs to be fixed.


RE: BFC and parts - Orion Pobursky - 2019-07-12

(2019-07-12, 5:00)Travis Cobbs Wrote: Where do they say that? The File Format Restrictions for the Official Library document specifically allows both CW and CCW. If the opposite is indicated somewhere else, then one of the documents needs to be fixed.

Its actually in the BFC spec itself. CCW is desired not required except for primitives:

"It is desirable for all files to use the same winding. When possible, files should use counter-clockwise winding. The actual winding for any part is left to the file author. Primitives should always use CCW winding."


RE: BFC and parts - Magnus Forsberg - 2019-07-12

(2019-07-11, 2:12)Travis Cobbs Wrote: If after step 1 the part is all (or mostly) red, you might want to change the BFC CERTIFY CCW ....

No.
I would instead keep the BFC CERTIFY CCW and select all surfaces and change all of their winding at once.
Now you will have a smaller number of bfc inverse surfaces to correct.


RE: BFC and parts - Michael Horvath - 2019-07-12

(2019-07-10, 23:36)Orion Pobursky Wrote: Not really. It's super easy:

- Add BFC CERTIFY CCW per the header spec
- Open the part in LDView
- In Preferences -> BFC, check the "green front faces" and "red back faces" options and click apply
- Look for any red
- If it's a tri/quad, reverse the winding
- If it's flat primitive, flip it 180
- If it's a non-flat primitive, put BFC INVERTNEXT before it
- Continue until there is no red

I tried this, but it involves a lot of guesswork figuring out which line represents which surface.

I tried the program LD Part Editor instead, but not all sub-parts/primitives are rendered for some reason. There is just empty space where some sub-parts/primitives are supposed to be. (Most Some of them seem to function properly however.)


RE: BFC and parts - Travis Cobbs - 2019-07-12

(2019-07-12, 11:17)Orion Pobursky Wrote: Its actually in the BFC spec itself. CCW is desired not required except for primitives:

"It is desirable for all files to use the same winding. When possible, files should use counter-clockwise winding. The actual winding for any part is left to the file author. Primitives should always use CCW winding."

Based on that, I still think that if you enable BFC on a non-BFC part, and it comes out almost all red, setting CW as the winding is a reasonable thing to do.