<aside> 🆕 This feature was introduced in xeokit-sdk v2.0.

</aside>

<aside> ℹ️ See also: Viewing a LAS Point Cloud with XKTLoaderPlugin

</aside>



Introduction

In this mini-tutorial, we'll use xeokit's [convert2xkt](<https://xeokit.github.io/xeokit-convert/docs/>) 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.

<aside> ▶️ Run this example

</aside>

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/89de2a42-3771-4d76-9bb6-8cf5e969a989/Screenshot_from_2021-03-05_17-09-54.png

1. Install convert2xkt

Using git and npm, clone and install our xeokit-convert repository, which contains the convert2xkt tool that we'll use to convert our glTF into XKT.

Be sure to use the latest versions of both xeokit-convert and xeokit-sdk.

git clone <https://github.com/xeokit/xeokit-convert.git>
cd xeokit-convert
npm install

2. Convert glTF to XKT

Now convert the glTF into an XKT file:

node convert2xkt.js -s MAP-pointcloud.gltf -o MAP-pointcloud.xkt -l

[convert2xkt] Reading input file: MAP-pointcloud.gltf
[convert2xkt] Input file size: 69896.88 kB
[convert2xkt] Converting...
[convert2xkt] Converted objects: 1
[convert2xkt] Converted geometries: 1
[convert2xkt] Converted triangles: 0
[convert2xkt] Converted vertices: 2621090
[convert2xkt] Converted to: XKT v9
[convert2xkt] XKT size: 21084.03 kB
[convert2xkt] Compression ratio: 3.32
[convert2xkt] Conversion time: 3.30 s
[convert2xkt] Writing XKT file: MAP-pointcloud.xkt