# jshpp

> Algorithms for Three Dimensional Path Planning

Latest version **0.1.5** (published 2021-11-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install jshpp
pnpm add jshpp
yarn add jshpp
bun add jshpp
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.5 |
| Published | 2021-11-02 |
| First published | 2021-01-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 572.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Kun-Neng |
| Maintainers | kunneng |
| Keywords | Path Planning Algorithms, A*, dijkstra |

## Links

- npm: https://www.npmjs.com/package/jshpp
- Repository: https://github.com/Kun-Neng/hpp
- Homepage: https://github.com/Kun-Neng/hpp/blob/main/typescript#readme
- Issues: https://github.com/Kun-Neng/hpp/issues
- npm.io page: https://npm.io/package/jshpp

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 0.1.5 (latest) — 2021-11-02
- 0.1.4-1 — 2021-09-01
- 0.1.4 — 2021-08-24
- 0.1.3 — 2021-08-19
- 0.1.2 — 2021-07-29
- 0.1.0 — 2021-06-24
- 0.0.5 — 2021-04-08
- 0.0.4 — 2021-03-22
- 0.0.3 — 2021-03-08
- 0.0.2 — 2021-01-16
- 0.0.1 — 2021-01-16

## README

jshpp
======
#### Node Package for Path Planning Algorithms ####

[![GitHub license](https://img.shields.io/github/license/Kun-Neng/hpp)](https://github.com/Kun-Neng/hpp/blob/main/LICENSE)

Steps
------
* Step 1: import A* algorithm
```javascript
const AStar = require('jshpp').AStar;
```

* Step 2: prepare a JSON type scenario, e.g.,
```javascript
const scenario = {
    "dimension": {"x": 10, "y": 10, "z": 10},
    "waypoint": {
        "start": {"x": 5, "y": 9, "z": 2},
        "stop": {"x": 5, "y": 0, "z": 4},
        "allowDiagonal": false
    },
    "data": {
        "size": 16,
        "x": [4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7],
        "y": [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6],
        "z": [2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5]
    },
    "boundary": {
        "zCeil": 6,
        "zFloor": 1
    }
};
```
> `dimension`: [required] whole dimension of the scenario. Two dimensional scenario can be set up when `"z": 0`<br>
> `waypoint`: [required] start and stop positions (default `allowDiagonal` is `False`)<br>
> `data`: obstacle data (set as empty if none)<br>
> `boundary`: the z-axis boundary of path for calculation<br>

* Step 3: create an A* instance
```javascript
const aStar = new AStar(scenario);
```

* Step 4: calculate and get the results
```javascript
const result = aStar.calculatePath();

const visited_Q = result.visited_Q;
const final_Q = result.final_Q;
const path = result.path;
```
This returned `result` contains the following main properties
> `visited_Q`: all the visited positions<br>
> `final_Q`: all the positions in the A* path<br>
> `path`: the A* path array from start to stop<br>
> `refined_path`: the A* path with minimum number of points<br>

and some useful information
> `message`: the information about path planning<br>
> `elapsed_ms`: the running milliseconds of path planning

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