Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fractal-noise

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fractal-noise

Fractal noise library

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11
decreased by-54.17%
Maintainers
1
Weekly downloads
 
Created
Source

Fractal Noise

build npm

Fractal noise library

Install

npm install fractal-noise

Examples

generateCylinder(width, height, { frequency: 0.04, octaves: 2 })

Low frequency, double octave cylinder

generateCylinder(width, height, { frequency: 0.06, octaves: 8 })

Medium frequency, high octave cylinder

generateLine(width) // (Replicated across y-axis)

Default line

generateLine(width, { frequency: 0.1 }) // (Replicated across x-axis)

High frequency line

generateRectangle(width, height)

Default rectangle

generateRectangle(width, height, { frequency: 0.04, octaves: 8 })

Low frequency, high octave rectangle

API

Options

The options object for each generate function contains the following properties:

  • amplitude?: number – Defaults to 1.0
  • frequency?: number – Defaults to 1.0
  • octaves?: number – Defaults to 1
  • persistence?: number – Defaults to 0.5
generateCylinder (circumference: number, height: number, options: Options = {}): Uint8Array[]

Generates a two-dimensional noise field formed around a three-dimensional cylinder, such that it is continuous across the x-boundaries.

generateLine (length: number, options: Options = {}): number[]

Generates a one-dimensional noise field.

generateRectangle (width: number, height: number, options: Options = {}): Uint8Array[]

Generates a two-dimensional noise field isolated to width and height (non-continuous noise).

Keywords

FAQs

Package last updated on 14 Feb 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc