npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@threert/voxel

v0.1.1

Published

The voxel engine for ThreeRT: destructible voxel levels, explosions and rigid bodies cut loose, meshed and ray-traced by the native renderer.

Readme

@threert/voxel

The voxel engine of ThreeRT, the hardware ray-traced engine with a three.js-style API: destructible voxel levels whose pieces break off, fall and collide, traced in real time.

npm license

Install

npm install @threert/scene @threert/voxel

What it does

Scene code describes the level and sends the edits. The voxels are loaded, edited, split and meshed in ThreeRT's native renderer (a Rust core that also builds for WebAssembly), never in the scene's JavaScript.

import { voxelLevel, voxelExplode, voxelCarve, voxelBodies } from "@threert/voxel";

// In setup: the level, from MagicaVoxel .vox files on one lattice.
voxelLevel({
  route: "mesh",
  palette: [
    { name: "air", color: [0, 0, 0], roughness: 1, metalness: 0 },
    { name: "brick", color: [0.55, 0.2, 0.15], roughness: 0.9, metalness: 0, hardness: "medium" },
  ],
  objects: [{ name: "wall", uri: "assets/wall.vox", position: [0, 0, 0], anchor: true }],
});

// In a world handler: a 2 m blast. What it cuts loose becomes rigid bodies.
voxelExplode(4, 1.5, 0, 2);
voxelCarve({ box: [0, 0, 0, 1, 3, 0.2] }); // a cut, whatever the hardness
for (const body of voxelBodies()) console.log(body.position);
  • Edits: voxelExplode, voxelCarve, voxelPaint, voxelAdd, as shapes in world metres. They are applied in fixed point, so the same commands give the same voxels on every machine (voxelHash).
  • Destruction: after an edit, what no chain of voxels joins to an anchor is cut loose as a rigid body (VoxelBody) of the physics world. It tumbles, lands and can be carved again.
  • Collision: the level is a collider without being asked, so Raycaster.intersectPhysics, shape casts and the game's own bodies meet it.
  • Fire and smoke: Explosions adds fireballs, their light and smoke to a blast.
  • In JavaScript too: VoxelGrid (sparse 8³ bricks), parseVox / encodeVox for MagicaVoxel files, and greedyMesh / voxelMesh for meshing a grid as ordinary geometry.

The native functions need a ThreeRT client or the engine built from source; they throw elsewhere. The design and its measurements are in VOXEL.md.

Running it

A voxel game runs inside a ThreeRT client: ThreeRT for macOS and iPhone, with threert dev for the edit-and-reload loop (getting started), or threert-render play built from the engine's source.

Links

threert.dev · Docs · Showcase · GitHub

MIT licence.