We ran our converter tools on each IFC file in our test collection using the CLI commands shown
below.
For each IFC file, we substitute "model" with the name of that file.
ifc2gltfcxconverter
The ifc2gltfcxconverter
tool is the first stage of our pipeline and converts IFC into
glTF and JSON-encoded IFC metadata. Contact us here if you would like to evaluate this tool.
ifc2gltfcxconverter -i model.ifc -o model.glb -m model.json -s 20 -t 1000 -e 3
This creates a set of glb
and JSON files that contain the IFC geometry and metadata, along with a JSON
manifest that
lists them, as shown below. The
tool splits the IFC into multiple files like this so that they may be processed more reliably by the next step, and ulltimately loaded more
reliably into
xeokit's browser-based viewer.
Note the tool's -s
option, which specifies that output glb
files should be a maximum of
20
Mb
each, in this case. Also, the -t
option splits the 3D geometry coordinates into tiled regions of size
1000 x 1000 x 1000
meters. That enables
the xeokit viewer to render geometry with huge real-world coordinates accurately, without rounding jitter.
.
├── model.glb.manifest.json
├── model_1.glb
├── model_1.json
├── model_2.glb
├── model_2.json
├── model_3.glb
├── model_3.json
├── model.glb
└── model.json
convert2xkt
The convert2xkt tool is the second stage of our pipeline, and
converts glTF into XKT,
which we can view in the browser with xeokit. This is a
NodeJS-based CLI tool that often needs us to allocate it some extra memory. Thanks to splitting our files, our NodeJS
process is not overwhelmed by any memory stress!
node --max-old-space-size=14000 convert2xkt -n -a model.glb.manifest.json -o model.xkt.manifest.json
That converts the glb
and JSON files into a set of XKT and JSON files, along with a JSON manifest that
lists them, as shown below. XKT is xeokit's web-friendly native binary model format, designed to load quickly into
its web viewer. The JSON files are the same files that were output by ifc2gltfcxconverter
. We could have caused those
JSON files to be embedded in the XKT, but since we configured convert2xkt
with externalMetadata: true
(see: convert2xkt Configs below), they are managed as external attachments in this pipeline setup.
.
├── model.xkt.manifest.json
├── model_1.xkt
├── model_1.json
├── model_2.xkt
├── model_2.json
├── model_3.xkt
├── model_3.json
├── model.xkt
└── model.json
xeokit-sdk
Finally, we visualize our XKT files in the browser using xeokit's web viewer. In JavaScript, we simply create a Viewer
,
add an XKTLoaderPlugin
,
and then load our XKT file manifest.