Autodesk / revit-ifc

IFC for Revit and Navisworks (2019+)
486 stars 196 forks source link

Material parsing should be decoupled from geometry processing during import leading to colour bugs #178

Open Moult opened 4 years ago

Moult commented 4 years ago

This article, among describing other material faults of Revit, also gives an example where a IfcFacetedBrep fails to show colour, whereas an IfcExtrudedAreaSolid shows colour.

https://forums.buildingsmart.org/t/where-and-how-will-my-colors-be-saved-in-ifc/1806/33?u=moult

This suggests a coupling between geometry processing and material processing, which should not be the case.

TrabacchinLuigi commented 4 years ago

Decoupling is blasphemy to the people who wrote this code ...

AngelVelezSosa commented 4 years ago

There are a number of issues here, which I will try to describe in a blahpemy-free way :)

  1. Revit itself tightly couples geometry and material information, which gets propagated to the API. In addition, there are many overrides of that tight coupling, in the form of paint, element materials, and compound structures. We can have a long discussion on the pros and cons of these methods, and if the Revit team in 1997 made the right decision or not (I think it is nuanced). Regardless, IFC export needs to deal with that, and while the code could be decoupled more, it is impossible for it to be completely decoupled.
  2. There are of course issues in the IFC export itself, many of which are being dealt with as part of the IFC4 certification process. I can't say that there won't be any issues afterwards, but i can say that there will definitely be fewer in the certified code.
  3. The IFC standard itself has too many different ways to apply material to geometry. Hopefully IFC5 can simplify this. It is not at all surprising that different viewers / applications would take the same information and show it differently. I am hoping that by simplifying IFC itself and using more shared technology, these dialects could be ameliorated.
  4. We are trying to work on ways to factor out code and make it more generic/reusable. That is part of our roadmap.
Moult commented 4 years ago

To add to this in defence of @AngelVelezSosa , IFC itself has coupled colours to geometry in some of the approaches. It is not in the example I provided, but I completely empathise with @AngelVelezSosa 's difficulties. In an ideal world, IFC would be made simpler first... but life is not ideal :(

TrabacchinLuigi commented 4 years ago

https://en.wikipedia.org/wiki/Adapter_pattern