Projects
View on GitHub
vanruesc/sparse-octree
vanruesc/sparse-octree has 128 GitHub stars and 17 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-16 19:09 UTC. Last push 2026-10-31.
What you can do
- Handles octant splitting
- Supports cubic octrees for reduced memory usage
- Adheres to a common octant layout
- Supports raycasting
Measured star growth
- in 24h
- 0
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
About
A sparse octree data structure.
Creative & MediaREADME.md
OriginalSparse Octree
A sparse, pointer-based octree data structure. For a linear implementation see linear-octree.
Demo · Sandbox · Documentation
Installation
This library requires the peer dependency three.
npm install three sparse-octree
Usage
Points
import { Vector3 } from "three";
import { PointOctree } from "sparse-octree";
const min = new Vector3(-1, -1, -1);
const max = new Vector3(1, 1, 1);
const octree = new PointOctree(min, max);
const myData = {};
const p1 = new Vector3(0, 0, 0);
const p2 = new Vector3(0, 0, 0.5);
octree.set(p1, myData);
octree.move(p1, p2);
octree.get(p2); // => myData
octree.remove(p2);
octree.get(p2); // => null
Custom Octrees
import { Octree, CubicOctant } from "sparse-octree";
export class CubicOctree extends Octree {
constructor(min, size) {
this.root = new CubicOctant(min, size);
}
}
Features
- Pointer-based structure
- Handles octant splitting
- Supports cubic octrees for reduced memory usage
- Dynamic depth
- Adheres to a common octant layout
- Supports raycasting
- Supports culling
- Can be extended to manage any data
- Provides a point management implementation
Contributing
Maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.