Suggestion: When converting from IFC to GLB, make the material of the GLTF file doubleSided #3519
Replies: 3 comments
-
This is a great suggestion. In IFC, the surface style can be defined to be on either the positive side, negative side, or both: https://ifc43-docs.standards.buildingsmart.org/IFC/RELEASE/IFC4x3/HTML/lexical/IfcSurfaceSide.htm https://ifc43-docs.standards.buildingsmart.org/IFC/RELEASE/IFC4x3/HTML/lexical/IfcSurfaceStyle.htm I'm not sure whether or not IfcOpenShell's iterator takes this into consideration. If it doesn't (@aothms will know), then defaulting to doubleSided is probably a good default until it becomes cleverer. |
Beta Was this translation helpful? Give feedback.
-
Some random comments:
All in all, I agree that enabling this by default in the current state of our software and IFC implementations is probably net positive. Feel free to send in a Pull Request (if you're not familiar with Git you can just edit here in the github web interface and it will sort things out for you). |
Beta Was this translation helpful? Give feedback.
-
Thank you @aothms and @Moult for your feedback. I have added a pull request here Please have a look when you can |
Beta Was this translation helpful? Give feedback.
-
Hello everyone,
I have noticed that when I am converting an IFC file to GLB, some faces of the model are transparent.
I initially wrote a post on stack overflow explaining the problem there
The answer (from Don McCurdy!) was to make the material double-sided. I have tested it and it works just fine.
I have found the place in the ifcOpenShell codebase where that change needs to happen. It's in the
GltfSerializer.cpp
file at line 101.json_["materials"].push_back({ {"doubleSided", true}, {"pbrMetallicRoughness", {{"baseColorFactor", base}, {"metallicFactor", 0}}} });
The extra change is only:
{"doubleSided", true}
I have a very big model of a house where this problem occurs but I have reduced and anonymised the file to a single IFC element (
IFCROOF
) and pasted it at the end of this message should you guys want to test out the problem.Let me know what you think?
If you are ok with it, I would like to submit a pull request for that change.
This is a small-ish IFC file that exhibits the problem.
Beta Was this translation helpful? Give feedback.
All reactions