All Projects → RobinCK → smooth-polyline

RobinCK / smooth-polyline

Licence: MIT License
〰️ Smoothing algorithm for 2D lines and polygons

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to smooth-polyline

GLGame
A Tiny 2D OpenGL based C++ Game Engine that is fast, lightweight and comes with a level editor.
Stars: ✭ 49 (+113.04%)
Mutual labels:  2d-graphics
canvas
Draw on an HTML 2D canvas in a web browser from a server program using WebSockets.
Stars: ✭ 71 (+208.7%)
Mutual labels:  2d-graphics
SimpleTilemap
A fast, easy way to generate runtime tilemaps in Unity
Stars: ✭ 37 (+60.87%)
Mutual labels:  2d-graphics
blend2d-rs
Blend2D Bindings for Rust
Stars: ✭ 20 (-13.04%)
Mutual labels:  2d-graphics
faur
⚒️✨ My personal C games framework. 2D graphics, sound, inputs, states, ECS, and misc utils for data, files, math, memory, strings, time, and more. Builds for Linux, Windows, Web, and embedded devices.
Stars: ✭ 55 (+139.13%)
Mutual labels:  2d-graphics
Pumpkin-Engine
A powerful and capable 2d game engine in Kotlin
Stars: ✭ 1 (-95.65%)
Mutual labels:  2d-graphics
scripts
Small, useful platform-agnostic scripts (mostly just for Linux) that don't justify having their own repo
Stars: ✭ 25 (+8.7%)
Mutual labels:  smooth
texture generator
Generating procedural textures
Stars: ✭ 23 (+0%)
Mutual labels:  2d-graphics
kubed
No description or website provided.
Stars: ✭ 68 (+195.65%)
Mutual labels:  2d-graphics
smoovy
A collection of small and useful js packages (smooth scrolling, utils, etc.) preventing copy & paste
Stars: ✭ 25 (+8.7%)
Mutual labels:  smooth
react-svg-pathline
React component for drawing SVG path through set of points, smoothing the corners
Stars: ✭ 42 (+82.61%)
Mutual labels:  smooth
SpriteShatter
SKSpriteNode animation extension to 'shatter' a node into smaller pieces
Stars: ✭ 28 (+21.74%)
Mutual labels:  2d-graphics
isometric
A lightweight JavaScript library, written in TypeScript to create isometric projections using SVGs
Stars: ✭ 53 (+130.43%)
Mutual labels:  2d-graphics
vger
2D GPU renderer for dynamic UIs
Stars: ✭ 122 (+430.43%)
Mutual labels:  2d-graphics
gridder
A Grid based 2D Graphics library
Stars: ✭ 51 (+121.74%)
Mutual labels:  2d-graphics
LOST--Java-2D-Game
2D side-scrolling game made in JAVA with sprite sheet animations
Stars: ✭ 2 (-91.3%)
Mutual labels:  2d-graphics
fb2d
2D graphics for Linux Frame Buffer
Stars: ✭ 20 (-13.04%)
Mutual labels:  2d-graphics
TileMapGenerator
Create your own 2D Maps with layer-by-layer system using Noise-Sample and BufferedImage pattern
Stars: ✭ 19 (-17.39%)
Mutual labels:  2d-graphics
react-svg-curve
React components to draw different types of curves with svg
Stars: ✭ 42 (+82.61%)
Mutual labels:  smooth
stochastic sierpinski
A stochastic method to generate an approximation to the Sierpinski triangle
Stars: ✭ 41 (+78.26%)
Mutual labels:  2d-graphics

smooth-polyline

Smoothing algorithm for 2D lines and polygons

npmBower versionNPM versionnpm

Install

CDN

Recommended: https://unpkg.com/smooth-polyline, which will reflect the latest version as soon as it is published to npm. You can also browse the source of the npm package at https://unpkg.com/smooth-polyline/

NPM

npm install smooth-polyline --save

Yarn

yarn add smooth-polyline

Bower

bower install smooth-polyline --save

Development Setup

# install dependencies
npm install

# build dist files
npm run build

Usage

  var smoothLine = smooth([[ 1, 1 ], [ 1, 2 ], [ 2, 2 ], [ 2, 1 ]]);
  /* 
    return [
      [1,1],
      [1,1.15],
      [1,1.8499999999999999],
      [1.15,2],
      [1.8499999999999999,2],
      [2,1.8499999999999999],
      [2,1.15],
      [2,1]
    ]
   */
  var smoothLine = smooth(smooth([[ 1, 1 ], [ 1, 2 ], [ 2, 2 ], [ 2, 1 ]]));

  /* 
    return [
      [1,1],
      [1,1.0225],
      [1,1.1275],
      [1,1.255],
      [1,1.7449999999999997],
      [1.0225,1.8724999999999998],
      [1.1275,1.9775],
      [1.255,2],
      [1.7449999999999997,2],
      [1.8724999999999998,1.9775],
      [1.9775,1.8724999999999998],
      [2,1.7449999999999997],
      [2,1.255],
      [2,1.1275],
      [2,1.0225],
      [2,1]
    ]
   */

License

MIT © Igor Ognichenko

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].