Socket
Book a DemoInstallSign in
Socket

sparse-octree

Package Overview
Dependencies
Maintainers
1
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sparse-octree

A sparse octree data structure.

Source
npmnpm
Version
5.1.1
Version published
Weekly downloads
358
-12.47%
Maintainers
1
Weekly downloads
 
Created
Source

Sparse Octree

Build status npm version Peer dependencies

A sparse octree data structure.

Extensive DemoAPI Reference

Installation

This library requires the peer dependencies iterator-result and math-ds.

npm install iterator-result math-ds
npm install sparse-octree

Usage

Custom Octrees
import { Octree, CubicOctant } from "sparse-octree";

export class CubicOctree extends Octree {

	constructor(min, size) {

		this.root = new CubicOctant(min, size);

	}

}
Points
import { Vector3 } from "math-ds";
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 = {};

octree.put(new Vector3(0, 0, 0), myData);
octree.fetch(new Vector3(0, 0, 0)); // => myData

A full point octree example can be found here.

Features

  • Base Functionality
    • Pointer-based structure
    • Handles octant splitting
    • Adheres to a common octant layout
    • Supports raycasting
    • Supports culling
    • Supports cubic octrees
    • Can be extended to manage any data
  • Provides a point management implementation

Octree Helper

The octree-helper module provides an octree visualisation tool for three.js.

Contributing

Maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.

Keywords

partition

FAQs

Package last updated on 06 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts