Skip to main content

xeokit's Automated Visual Test Suite

· 5 min read
Anna Wilczura
Software Engineer @ Creoox

Introduction

With xeokit supported in most major browsers, it's impossible to maintain that support through manual testing. In this guide, we offer a quick look at how we use continuous integration and automated visual testing to ensure that xeokit continues to work as expected. This is just the bare beginnings of our test suite, which will become more sophisticated as we continue to build it up.

Automatically Splitting Large Models for Better Performance

· 7 min read

To most efficiently view IFC model files in xeokit, we first convert them to XKT files. This conversion allows for fast loading into the browser. We have extended xeokit to automatically split IFC files into multiple XKT files during conversion. This feature enables us to view even bigger models in the browser, like the 2GB Baku Stadium IFC model, shown in the screenshot above.

By splitting models during conversion, we improve xeokit's performance and stability. This is achieved by reducing the memory stress on the converter tools and the xeokit viewer components. These components perform much more reliably and faster when dealing with smaller files (e.g., 20MB) than larger files (e.g., 500MB). Larger files may cause difficulty allocating sufficient system memory for conversion and parsing.

In this tutorial, we’ll show how to use this new feature with our conversion and model viewing components. The IFC file we’ll use for this tutorial is the Karhumaki Bridge model from http://drumbeat.cs.hut.fi/ifc/. It’s not exactly a huge model, but good for demonstration purposes. It does contain a lot of rebar objects though (concrete reinforcing), so nevertheless is a fairly complex model, geometrically speaking.

Converting IFC to XKT using ifc2gltfcxconverter

· 7 min read

See also: Converting Models to XKT with convert2xkt Automatically Splitting Large Models for Better Performance

The xeokit SDK enables us to load large, full-precision BIM models over the Web in seconds and view them in the browser. To do this, we pre-convert our IFC files into xeokit's native XKT format. The XKT format compresses model geometry and metadata into a compact payload that a xeokit viewer can load quickly while using minimal browser resources.

In this tutorial, we'll use a combination of the closed-source ifc2gltfcxconverter tool from Creoox AG and the open source convert2xkt tool from xeolabs to convert an IFC 4 model into an XKT file, which we'll then load into a xeokit Viewer. This combination is the most efficient IFC → XKT conversion option we have so far, industrial-strength stuff.

Converting Models to XKT with convert2xkt

· 5 min read

The xeokit SDK enables us to load large, full-precision BIM and AEC models over the Web in seconds and view them in the browser. To do this, we pre-convert our models into xeokit's native XKT **format. The XKT format compresses model geometry and metadata into a compact payload that a xeokit viewer can load quickly while using minimal browser resources.

In this mini-tutorial, we introduce convert2xkt, a new JavaScript function and CLI tool that converts several 3D model formats into XKT format.

We provide convert2xkt as an additional conversion option for your models, alongside our existing standard open source IFC→XKT conversion pipeline.

Note that the pipeline in this tutorial only converts IFC element structure, and does not convert property sets. For property sets, we recommend Converting IFC Models to XKT using ifc2gltf.

Viewing a glTF Point Cloud with XKTLoaderPlugin

· 2 min read

Introduction

In this mini-tutorial, we'll use xeokit's convert2xkt CLI tool to convert a point cloud model from LAS/LAZ into xeokit's native XKT geometry format, which we'll then view in the browser using a xeokit Viewer.

The XKT format compresses models into a compact payload from which xeokit can load large numbers of objects over the Web in seconds, at full geometric precision.

For our glTF file, we'll use a point cloud capture of an apartment in Lyon, France, which was provided by BIMData. When that's converted and loaded, it will look like the example below. This model contains 2.6 million points, and xeokit can usually load it over a good Internet connection in around ~5 seconds.

Viewing a LAS Point Cloud with XKTLoaderPlugin

· 2 min read

Introduction

In this mini-tutorial, we'll use xeokit's convert2xkt CLI tool to convert a point cloud model from LAS format into xeokit's compact XKT native model format, which we'll then view in the browser using a xeokit Viewer.

LAS is an open format for the interchange and archiving of lidar point cloud data.

The XKT format compresses models into a compact payload from which xeokit can load large numbers of objects over the Web in seconds, at full geometric precision.

For our point cloud file, we'll use an LAS point cloud capture of the Autzen Stadium in Oregon, provided by http://loaders.gl . When that's converted and loaded, it will look like the example below. This model contains 31 million points, and xeokit can usually load it over a good Internet connection in around ~15 seconds.

Viewing .BIM in a xeokit Viewer

· 5 min read

Released in: https://github.com/xeokit/xeokit-sdk/releases/tag/v2.6.13

Summary

The DotBIMLoaderPlugin class enables us to to load .bim models into a xeokit Viewer.

When loading a .bim model, the DotBIMLoader does the following:

  • Creates an Entity representing each .bim model it loads, which will have Entity#isModel set true and will be registered by Entity#id in Scene#models.
  • Creates an Entity for each object within the .bim model. Those Entities will have Entity#isObject set true and will be registered by Entity#id in Scene#objects.
  • When loading, can set the World-space position, scale and rotation of each model within World space, along with initial viewer state for all the model's Entitys.
  • Allows to mask which IFC types we want to load.
  • Allows to configure initial viewer state for specified IFC types (color, visibility, selection, highlighted, X-rayed, pickable, etc).
  • Supports viewing of geographically large or distant models using xeokit's double-precision coordinate system

Viewing an IFC Model with XKTLoaderPlugin

· 3 min read

Introduction

In this mini-tutorial, we'll use xeokit's [convert2xkt](<https://xeokit.github.io/xeokit-convert/docs/>) CLI tool to convert an IFC 4.3 model into xeokit's native XKT geometry format, which we'll then view in the browser using a xeokit Viewer.

The XKT format compresses models into a compact payload from which xeokit can load large numbers of objects over the Web in seconds, at full geometric precision.

For our IFC model, we'll use an architectural model from the Revit Sample Project Files. When that's converted and loaded into our viewer, it will look like the example below.

This model contains 5512 visible objects, with 283238 triangles, and a xeokit Viewer can usually load it over a good Internet connection in ~2 seconds.

Viewing Multiple Models

· 3 min read

Introduction

xeokit-sdk can load multiple models from a variety of file formats into the same 3D scene.

Supported formats (so far) include IFC, glTF, DAE, OBJ, STL and 3DXML. Regardless of where models were loaded from, xeokit exposes their objects via an abstract interface through which we can access them uniformly.

In this tutorial, you'll load several models from different formats into the same scene, then update rendering states on a couple of their objects.