This article details how to convert IFC data to OGC 3D Tiles.

If you want to visualize large IFC datasets and maintain application performance, you must convert the IFC data to the OGC 3D Tiles format. OGC 3D Tiles is an optimal format for visualizing large geographical datasets. After the conversion, you can visualize the data on a Lightspeed view, as explained in the Visualize OGC 3D Tiles data on a Lightspeed map article.

LuciadFusion can natively serve IFC data as an OGC 3D Tiles service. For that use case, you don’t need a manual conversion to OGC 3D Tiles.

Check the LuciadFusion documentation for more information on how to serve the IFC data as OGC 3D Tiles.

To convert the IFC data to OGC 3D Tiles, you have two options: you can perform the conversion programmatically, or you can run an IFC data conversion script from the command line.

Converting IFC data to OGC 3D Tiles in your code

To convert IFC data to OGC 3D Tiles:

  1. Decode the IFC data into an ILcdModel using the TLcdIFCModelDecoder.

    ILcdModelDecoder decoder = new TLcdIFCModelDecoder();
    ILcdModel model = decoder.decode(sourceName);
  2. Encode the generated model to OGC 3D Tiles using a TLcdOGC3DTilesModelEncoder:

    TLcdOGC3DTilesModelEncoder encoder = new TLcdOGC3DTilesModelEncoder();
    encoder.export(model, outputPath);

The resulting OGC 3D Tiles dataset is written to the given outputPath location.

Converting IFC data to OGC 3D Tiles from the command line

To convert IFC data to OGC 3D Tiles from the command line, go to the samples folder, and select the appropriate script to run:

  • decoder.ifc.bat on Windows systems

  • on Linux systems

For example:

decoder.ifc.bat -i D:\Formats\IFC\someIfcFile.ifc -o C:\Users\user1\3dtilesoutput

You must run the script with these parameters:

  • -i path/to/<projectfile>: specify the IFC project file, either a <project>.ifc file or a <project>/.ifc.index with its folder path.

  • -o path/to/output/: specify the path to the output folder for the OGC 3D Tiles.

Adding georeference information

Make sure that georeference information is available in the input folder with IFC data. You can provide georeference information in a .llh, .ref, or .prj file with the same name as the data file.

.llh files contain longitude, latitude, and height, defined in the default EPSG 4326 reference.

Optionally, you can add the -g and -m command parameters:

  • You can use the -g command parameter to add a GeoJSON file to the output folder.

    decoder.ifc.bat -g -i D:\Formats\IFC\someIfcFile.ifc -o C:\Users\user1\3dtilesoutput

    The GeoJSON file contains information about the structural elements in the IFC data, such as doors and walls. A bounding box is also included, but not the full geometry. For more information about GeoJSON conversion, see the Converting IFC data to GeoJSON tutorial.

  • You can use the -m command parameter to specify the mesh compression you want to apply. You can set it to either DRACO or NONE. See ELcdOGC3DTilesMeshCompressionType for more information about the meaning of these values. If this parameter is not specified, the DRACO compression is used.

    decoder.ifc.bat -m DRACO -i D:\Formats\IFC\someIfcFile.ifc -o C:\Users\user1\3dtilesoutput