Skip to main content

Hello,

I've encountered an issue with how color attributes are read by the different IFC readers.

The IFC reader (deprecated) reads a color value as the diffuse color, but the newer IFC_API reader reads the exact same value as the ambient color.

Consequently, when using a writer like the CityGML writer, the diffuse color information is missing, which results in incorrect materials being created in the output file.

Let me show you with a simple IFC example.

When viewed with BIMVision:

 

The color appears correctly as expected.

 

When read with the IFC reader (deprecated):

The geometry has the diffuse color, which is correct.

 

When read with the IFC_API reader:

The geometry has the ambient color instead of diffuse.

 

What is the recommended way to handle this? Do I need to wait for the next version for a fix?

As a temporary workaround, would it be possible to change the ambient color to diffuse color? This seems difficult because in my actual project files, the hierarchical position of the geometry part that has the appearance applied is not always at the root; it varies from case to case.

Any help on this would be appreciated.

Thank you.

Oh, thats ultra annoying.

 

There is a way to replace/update appearances. You need a combination of the SharedItemRetriever, AppearanceStyler and SharedItemSetter. 

 

All the appearances have an ID and are stored in a shared "library". This means is features share an ID then you just need to update it once. 

 

Check out the ColorApperanceReplacer which will replace all diffuse colors with a textures of the same color. You can use this as a bit of a guide/template in how it works. 


Reply