Skip to content

xeokit/xeokit-model-conversion-tests

Repository files navigation

xeokit-model-conversion-tests

This project provides a Node.js script that automatically runs a directory of IFC files through each of our IFC->XKT conversion pipelines and generates the Model Conversion section of the xeokit website to show the results.

We can also use this project to test the conversion pipelines locally.

Install

npm install

Configure

Install the CLI tools we'll use in our conversion pipelines: IfcConvert, xeokit-metadata, ifc2gltf and convert2xkt.

Then configure ./convertconfig.json with paths to those tools - for example:

{
  "paths": {
    "IfcConvert": "~/xeolabs/xeokit/IfcConvert/IfcConvert-v0.7.0-e508fb4-linux64/IfcConvert",
    "xeokit-metadata": "xeokit-metadata",
    "convert2xkt": "~/xeolabs/xeokit/xeokit-convert/convert2xkt.js",
    "ifc2gltf": "~/xeolabs/xeokit/ifc2gltf/2_6_5/ifc2gltfcxconverter-2.6.5/linux/build/Release/ifc2gltfcxconverter"
  }
}

Drop in your IFC Files

Drop the IFC files you want to convert into ./inputFiles.

For example:

./inputFiles/
├── Archicad
│    ├── Archicad-Demoprojekt.ifc
│    └── AR-Demo_Sample_Building_01.ifc
├── BIMData
│    ├── 19_rue_Marc_Antoine_Petit_Ground_floor.ifc
│    └── MAP.ifc
├── blenderbim
│    └── auto-geolocation.ifc
└─── buildingSMART_IFC2.3
     └── Clinic_Architectural.ifc

Run tests

Run the test script and build the HTML pages:

npm run build

Review results

When the test script has finished, the ./results directory will contain converted XKT files, along with intermediate glTF and JSON files created by some of the pipelines. The directory will also contain logging output collected from the CLI tools.

./results/
├── Archicad
│   ├── Archicad-Demoprojekt
│   │   ├── ifcCommunityPipeline1
│   │   │   ├── log.txt
│   │   │   ├── model.glb
│   │   │   ├── model.json
│   │   │   └── model.xkt
│   │   ├── ifcCXConverterPipeline1
│   │   │   ├── log.txt
│   │   │   ├── model.glb
│   │   │   ├── model.json
│   │   │   └── model.xkt
│   │   └── model.ifc
│   └── AR-Demo_Sample_Building_01
│       ├── ifcCommunityPipeline1
│       │   ├── log.txt
│       │   ├── model.glb
│       │   ├── model.json
│       │   └── model.xkt
│       ├── ifcCXConverterPipeline1
│       │   ├── log.txt
│       │   ├── model.glb
│       │   ├── model.json
│       │   └── model.xkt
│       └── model.ifc
├── BIMData
│   ├── 19_rue_Marc_Antoine_Petit_Ground_floor
│   │   ├── ifcCommunityPipeline1
│   │   │   ├── log.txt
│   │   │   ├── model.glb
│   │   │   ├── model.json
│   │   │   └── model.xkt
│   │   ├── ifcCXConverterPipeline1
│   │   │   ├── log.txt
│   │   │   ├── model.glb
│   │   │   ├── model.json
│   │   │   └── model.xkt
│   │   └── model.ifc
│   └── MAP
│       ├── ifcCommunityPipeline1
│       │   ├── log.txt
│       │   ├── model.glb
│       │   ├── model.json
│       │   └── model.xkt
│       ├── ifcCXConverterPipeline1
│       │   ├── log.txt
│       │   ├── model.glb
│       │   ├── model.json
│       │   └── model.xkt
│       └── model.ifc
├── blenderbim
│   └── auto-geolocation
│       ├── ifcCommunityPipeline1
│       │   ├── log.txt
│       │   ├── model.glb
│       │   ├── model.json
│       │   └── model.xkt
│       ├── ifcCXConverterPipeline1
│       │   ├── log.txt
│       │   ├── model.glb
│       │   ├── model.json
│       │   └── model.xkt
│       └── model.ifc
├── buildingSMART_IFC2.3
│   └── Clinic_Architectural
│       ├── ifcCommunityPipeline1
│       │   ├── log.txt
│       │   ├── model.glb
│       │   ├── model.json
│       │   └── model.xkt
│       ├── ifcCXConverterPipeline1
│       │   ├── log.txt
│       │   ├── model.glb
│       │   ├── model.json
│       │   └── model.xkt
│       └── model.ifc
└── systemInfo.json

To review the test results, fire up an HTTP server:

http-server

Go to localhost:8080/index.html: