Fast 2D/3D spatial indexing and search

Usage no npm install needed!

<script type="module">
  import elmarquezSpatialhash from 'https://cdn.skypack.dev/@elmarquez/spatialhash';


Spatial Hash

Fast spatial indexing and search for three.js.

Internally, the library stores data in a non-THREE format to make it easier to execute functions on workers. As a result, you will need to transform positional information back into THREE objects when pulling data from the index.

Add spatialhash as a dependency to your project:

npm install -S @elmarquez/spatialhash


Install all development dependencies:

npm install

Building a Distribution

Build the library:

npm run build

Test the distribution:

npm run test


Research papers on spatial hashes, comparison to other data structures:

Spatial hash implementations:

To Do

  • Reimplement in TypeScript.


See the LICENSE file.