# @elmarquez/spatialhash

> Fast 2D/3D spatial indexing and search

Latest version **0.1.6** (published 2021-04-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install @elmarquez/spatialhash
pnpm add @elmarquez/spatialhash
yarn add @elmarquez/spatialhash
bun add @elmarquez/spatialhash
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.6 |
| Published | 2021-04-04 |
| First published | 2021-04-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.3 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Davis Marques |
| Maintainers | elmarquez |
| Keywords | three, threejs, 3D, search, spatial, hash, index |

## Links

- npm: https://www.npmjs.com/package/@elmarquez/spatialhash
- Repository: https://github.com/elmarquez/spatialhash.js
- Issues: https://github.com/elmarquez/spatialhash.js/issues
- npm.io page: https://npm.io/package/@elmarquez/spatialhash

## Alternatives

- [@gemini-wallet/core](https://npm.io/package/@gemini-wallet/core.md) — 515.6K weekly downloads
- [utility](https://npm.io/package/utility.md) — 416.6K weekly downloads
- [@primno/dpapi](https://npm.io/package/@primno/dpapi.md) — 7.2K weekly downloads
- [pi-readseek](https://npm.io/package/pi-readseek.md) — 3.7K weekly downloads
- [@emilia-protocol/verify](https://npm.io/package/@emilia-protocol/verify.md) — 1.1K weekly downloads

## Recent versions

- 0.1.6 (latest) — 2021-04-04

## README

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



Dependencies
------------

Install all development dependencies:

    npm install


Building a Distribution
-----------------------

Build the library:

    npm run build

Test the distribution:

    npm run test


Discussion
----------

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

* Optimization of Large-Scale, Real-Time Simulations by Spatial Hashing
  http://www.cs.ucf.edu/~jmesit/publications/scsc%202005.pdf
* Quadtree vs. Spatial Hashing - a Visualization http://zufallsgenerator.github.io/2014/01/26/visually-comparing-algorithms/
* http://www.gamedev.net/page/resources/_/technical/game-programming/spatial-hashing-r2697
* http://matthias-mueller-fischer.ch/publications/tetraederCollision.pdf

Spatial hash implementations:

* http://zufallsgenerator.github.io/assets/code/2014-01-26/spatialhash/spatialhash.js
* http://entitycrisis.blogspot.com.au/2011/07/spatial-hash-in-javascript-for-2d.html
* https://www.npmjs.com/package/spatial-grid
* https://conkerjo.wordpress.com/2009/06/13/spatial-hashing-implementation-for-fast-2d-collisions/


To Do
-----

* Reimplement in TypeScript.


License
-------

See the LICENSE file.

---
_Source: https://npm.io/package/@elmarquez/spatialhash · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
