Skip to content

voxel-toolMagicaVoxel .vox toolkit

Pure-JS core + Three.js real-3D viewer (React / Vue / Solid / Preact / Svelte / Qwik)

voxel-tool
voxel-tool — What's new in P4

What is this? ​

voxel-tool is a JavaScript toolkit for MagicaVoxel .vox voxel models:

  • @voxel-tool/core — Pure-JS core: .vox read/write, palette helpers, and the VoxelGrid container.
  • @voxel-tool/mesh — Shared voxel-geometry core (Three.js): the single face-culling + greedy-meshing buildVoxelGeometry implementation, reused by both @voxel-tool/viewer and @voxel-tool/exporter; color-space and material differences are parameterized.
  • @voxel-tool/viewer — Framework-agnostic Three.js viewer core (createVoxelViewer + buildVoxelGeometry); every framework component reuses it.
  • @voxel-tool/exporter — Standalone export library: voxel models → GLB / glTF / OBJ / STL / PLY / USDZ / FBX, plus lossless .vox round-trip and glTF/GLB animation baking.
  • @voxel-tool/cli — Headless Node CLI: convert .vox ↔ GLB/glTF/OBJ/STL/PLY/USDZ/FBX, voxelize meshes, run boolean CSG, and round-trip Minecraft Schematic — no browser required.
  • @voxel-tool/react — React 3D viewer component (Three.js).
  • @voxel-tool/vue — Vue 3 3D viewer component (same rendering approach).
  • @voxel-tool/solid — SolidJS 3D viewer component.
  • @voxel-tool/preact — Preact 3D viewer component.
  • @voxel-tool/svelte — Svelte 5 3D viewer component.
  • @voxel-tool/qwik — Qwik 3D viewer component.

The renderer follows the approach of mainstream .vox viewers: real 3D cubes + depth buffer + face culling + orthographic isometric camera + OrbitControls, leaving Canvas 2D painter's-algorithm sorting artifacts behind. Every framework component shares the single @voxel-tool/viewer implementation — no duplicated rendering code per framework.

bash
npm install @voxel-tool/core @voxel-tool/react
jsx
import { VoxViewer } from '@voxel-tool/react';
import { parseVox } from '@voxel-tool/core';

const buf = await fetch('/model.vox').then((r) => r.arrayBuffer());
const { models, palette } = parseVox(buf);

export default function App() {
  return <VoxViewer model={models[0]} palette={palette} />;
}

🇨🇳 中文文档

MIT Licensed © 2026 Maicarons