Assimp for JavaScript

Model in, model out.

libassimp reads 69 model-file extensions and writes 15 canonical formats, in Node.js, the browser and workers. Hand it the bytes of a model, name the format you want back, and it returns the converted bytes.

import { convert } from 'libassimp';const response = await fetch('/cube.obj');const bytes = new Uint8Array(await response.arrayBuffer());const { files } = await convert({ name: 'cube.obj', bytes }, { to: 'glb' });console.log(files[0].name, files[0].bytes.byteLength);

Input

objcube.obj136 B

Output

Preparing artifact…

Convert
Output
Files
WASM load
Wasm
2.1 MB
JS API
0.4 KB

Brotli-compressed libassimp.wasm, plus the gzipped JavaScript entrypoint. One artifact provides the complete import and export catalog.