https://github.com/leodeslf/worley-noise
A Worley Noise library for JavaScript.
https://github.com/leodeslf/worley-noise
worley-noise
Last synced: 8 months ago
JSON representation
A Worley Noise library for JavaScript.
- Host: GitHub
- URL: https://github.com/leodeslf/worley-noise
- Owner: leodeslf
- License: mit
- Created: 2021-09-28T00:31:53.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-10-01T20:59:55.000Z (over 4 years ago)
- Last Synced: 2025-10-12T04:43:06.015Z (8 months ago)
- Topics: worley-noise
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/@leodeslf/worley-noise
- Size: 104 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Worley Noise
```txt
____________ ____________
/___________/\ / ________ /\
\ ________ \ \/ /\______/ / /
\ \ \ \ \ \/ / / / /
\ \ \ \ \ \/ / / /
\ \ \ /\ \ \ / / /
\ \ \ / /\ \ \ / / /
\ \ \/ / /\ \ \/ / /
\ \ \/ / \ \ \/ /
\_\__/ \_\__/
```
## About
A Worley Noise library for JavaScript.
## Feature Shape
|`Worley`
|---
|`spots: Vec2[] \| Vec3[]`
|`set dimention: '2d' \| '3d'`
|`set metric: 'euclidean' \| 'manhattan' \| 'chebyshev' \| 'minkowski'`
|`st(position: Vec2 \| Vec3, e?: number = 3): number` (1st closest)
|`nd(position: Vec2 \| Vec3, e?: number = 3): number[]` (1st and 2nd closest)
## Install
```bash
npm i @leodeslf/worley-noise
```
## Import
```javascript
import Worley from '@leodeslf/worley-noise';
```
## Usage
```javascript
const worley = new Worley(
spots,
'3d', // Default '2d' (optional).
'manhattan' // Default 'euclidean' (optional).
);
worley.st(position);
```
[Live demo here](https://leodeslf.github.io/worley-noise/ "GitHub Pages") (3d, euclidean, nd - st).
## Author
[Leonardo de S.L.F](https://github.com/leodeslf "GitHub profile").
## License
MIT License.