entityToVox()
Serialise an entity to .vox. MagicaVoxel stores coordinates in single bytes, so no axis may exceed 255; larger models throw rather than silently wrapping. Role colours become the file's palette (role v at index v); materials, rigs and clips are not written. Dense models only: a sparse model has...
function entityToVox(entity: Entity): ArrayBuffer;Defined in: engine/src/vox.ts:125
Serialise an entity to .vox. MagicaVoxel stores coordinates in single
bytes, so no axis may exceed 255; larger models throw rather than silently
wrapping. Role colours become the file's palette (role v at index v); materials, rigs and
clips are not written. Dense models only: a sparse model has empty data and writes nothing.
Parameters
| Parameter | Type |
|---|---|
entity | Entity |
Returns
ArrayBuffer
The file's bytes.
Example
const bytes = entityToVox(tree);
const url = URL.createObjectURL(new Blob([bytes]));