Imports and exports xeokit's legacy XKT binary format.
XKT is the native binary format of xeokit v2, produced by xeokit-convert. It
has been superseded by XGF in v3, but is still supported for
compatibility with existing XKT assets. XKTLoader reads the geometry,
meshes, and objects into a SceneModel, and the
embedded model / object metadata into a DataModel;
XKTExporter writes a SceneModel + DataModel back out as XKT.
An XKT file pools all geometry into shared arrays of 16-bit quantised
positions, indices, and per-mesh material attributes, grouped into spatial
tiles. Geometry used by a single mesh is baked into its tile's coordinate
frame; geometry shared by several meshes is instanced. The loader reconstructs
this into SceneModel geometries, meshes (placed with a per-tile RTC origin
for full precision), and objects, and maps the metadata metaObjects into a
DataModel object tree with aggregation relationships.
Scope
Loading: XKT versions 7 through 12. Versions 7-10 use the legacy
zlib-deflated container; versions 11-12 use the uncompressed offset-table
container emitted by current xeokit-convert. Versions 1-6 are not handled.
Triangle (solid / surface), line, and point primitives.
Per-mesh colour and opacity; metallic / roughness, textures, texture sets,
and UVs are not applied.
Metadata is mapped to a DataModel from version 8 onwards (v8 stores it as
parallel arrays; v9+ as a JSON document); versions 7 and earlier carried
metadata in a separate file.
Export writes XKT version 12 only: a single tile and one geometry per
mesh (geometry is not re-instanced) with no textures.
xeokit Legacy XKT Importer / Exporter
Imports and exports xeokit's legacy XKT binary format.
XKT is the native binary format of xeokit v2, produced by
xeokit-convert. It has been superseded by XGF in v3, but is still supported for compatibility with existing XKT assets. XKTLoader reads the geometry, meshes, and objects into a SceneModel, and the embedded model / object metadata into a DataModel; XKTExporter writes a SceneModel + DataModel back out as XKT.An XKT file pools all geometry into shared arrays of 16-bit quantised positions, indices, and per-mesh material attributes, grouped into spatial tiles. Geometry used by a single mesh is baked into its tile's coordinate frame; geometry shared by several meshes is instanced. The loader reconstructs this into SceneModel geometries, meshes (placed with a per-tile RTC
originfor full precision), and objects, and maps the metadatametaObjectsinto a DataModel object tree with aggregation relationships.Scope
xeokit-convert. Versions 1-6 are not handled.solid/surface), line, and point primitives.Usage
The loader's / exporter's
fileDataTypeis"arraybuffer", so read the.xktas anArrayBufferfirst, and the exporter resolves to one.