Closed wlinna closed 5 months ago
Hi @wlinna!
Have you tried to apply the FragmentsGroup.coordinationMatrix to the elements right before exporting the model to GLB?
EDIT: Hi there, thanks for the response!
When I apply coordinationMatrix to the model, I do it on the root of the model. However, whether I apply it or not, this problem remains the same. I have indeed tried.
Hi @wlinna this might happen due to 2 reasons:
1 - You are probably using the web-ifc option OPTIMIZE_PROFILES: true
. This is something that we set as true by default because it helped with performance, but now that we have streaming we are removing that option for simplicity's sake. Basically, this deduplicates all circular and rectangular extrusions. This shouldn't be an issue in future versions, and if you are using a past version, you can already disable that by setting that option to false when reading an IFC.
2 - Because the shear comes from the IFC itself.
If the cause is 1, is solved. If the cause is 2, there's nothing we can do, because we are just reading the transformations present in the IFC and using them to create the geometry. Either way, this issue is either solved, or has no solution. Let us know!
Thank you, OPTIMIZE_PROFILES
was the cause. The problem disappears once I disable it
Describe the bug 📝
When I import certain models with IfcFragmentLoader, the loading process introduces shearing to the matrices. Shearing is not supported well by some engines. See this issue for example.
There's no clear way to detect shearing in matrices, which means that the only way to make geometries generated by
IfcFragmentLoader
to work outside is to duplicate them and apply the corresponding instance matrices to them. This wastes memory and / or increases file sizes (if for example I decide to export the model in glTF format). And figuring out the problem can be very difficult in the first place.Reproduction ▶️
https://shear-problem.netlify.app/
Steps to reproduce 🔢
The problem is that the matrix cannot be decomposed cleanly into
position
,rotation
andscale
as has been established in this issue this issue.The code is unoptimized so it can be read. And it's based on IfcFragmentLoader example with some extras removed (and IfcSite is added to the excluded categories).
System Info 💻
Used Package Manager 📦
npm
Error Trace/Logs 📃
No response
Validations ✅