Closed AlexanderMelde closed 5 months ago
Hi Alexander,
Note that glTF/GLB does not contain IFC semantic data (metadata), it only contains model geometry and materials.
To load IFC semantic data, you need to also load a JSON file alongside the glTF/glb that supplies the element hierarchy and property sets to xeokit, eg:
const sceneModel = gltfLoader.load({
id: "myModel",
src: "../../assets/models/gltf/Schependomlaan/glTF-Embedded/Schependomlaan.gltf",
metaModelSrc: "../../assets/models/gltf/Schependomlaan/Schependomlaan.json",
edges: true
});
Note also that we usually convert the glTF/glb to XKT for best results. Loading glTF/glb is possible, but XKT does some pre-conditioning to the data that makes it load a lot faster for large models.
We offer a couple of flavors of IFC->glTF/XKT conversion, but only one of them supports property sets at this time.
More information on IFC conversion here: https://xeokit.github.io/xeokit-model-conversion-tests/ifc-tests.html
If your enterprise needs prioritised support while evaluating xeokit, we'd be happy to help - if so, please get in touch here: https://creoox.com/en/contact/
thanks Lindsay
Hello Lindsay,
thank you for these explanations! The links provided are useful as well for understanding the different file types.
I now have two follow-up questions:
Thank you for your help!
Hi no problem -
- Does the GLTFLoaderPlugin use convert2xkt.js internally?
No, that just loads the glTF/glb directly into the xeokit Viewer. Note that as it does this, it will do a couple of things to the geometry on-the-fly ( 1. convert vertex coordinates to tiled coordinate system for precise double-precision rendering, and 2. quantize the vertex positions to integers for lower memory usage), that convert2xkt does offline when creating XKT. This is one reason we often pre-convert to XKT first, so those two things don't have to happen at loading time.
FYI we use the loaders.gl library internally within that plugin, to parse the glTF/glb.
Also FYI: although XKT is what we recommend for IFC models, that plugin is actually the best option for loading triangulated LiDAR comprised of textured triangle meshes. It handles the big textures more smoothly than XKT does.
- Does the metamodel JSON file follow a certain standard, or is this a xeokit-specific format? I found a repo called xeokit-metadata, does this schema contain the structure for these JSON files? And I assume it is not ifcJSON?
Yes, xeokit metamodel JSON conforms to the schema described here: https://github.com/xeokit/xeokit-convert/blob/main/specs/index.md
Currently we're at v10. It's not ifcJSON - it's more optimized for loading into xeokit.
The BIMSpot tool is not something we're collaborators on, so I'm not sure what the conformance of that is with our latest spec.
Thank you, this helps us a lot!
Hello,
we are currently evaluating the use of xeokit for our BIM viewer and we are looking for an simple way to load GLB / GLTF files into the xeokit viewer.
The GLTFLoaderPlugin seems like the perfect fit, but we cannot load Properties (IFC propertysets etc.) with it, the inspector does not open properly.
Full Source Code index.html (from your example)
Someone else asked how to use the loader plugin a year ago, but did not get a very detailed answer.
When using the default loader, the inspector is shown:
This code seems to do it in your own viewer, but that one can only load xkt, not glb: https://github.com/xeokit/xeokit-bim-viewer/blob/master/src/BIMViewer.js#L211C38-L211C54
Can you provide us with an example of how to open glb files and inspect their properties?
When using convert2xkt.js we need an additional json file to include properties in the xkt file, so were hoping the GLTFLoaderPlugin can open glb files with properties without the additional json file.
Kind Regards Alexander