<aside> 🆕 This feature was introduced in xeokit-sdk v2.0.
</aside>
<aside> ℹ️ See also: Viewing a LAS Point Cloud with XKTLoaderPlugin
</aside>
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>
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
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