adaptive-bezier-curve

WebJar for adaptive-bezier-curve

License

License

BSD 3-Clause
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

adaptive-bezier-curve
Last Version

Last Version

1.0.3
Release Date

Release Date

Type

Type

jar
Description

Description

adaptive-bezier-curve
WebJar for adaptive-bezier-curve
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/mattdesl/adaptive-bezier-curve

Download adaptive-bezier-curve

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/adaptive-bezier-curve/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>adaptive-bezier-curve</artifactId>
    <version>1.0.3</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/adaptive-bezier-curve/
implementation 'org.webjars.npm:adaptive-bezier-curve:1.0.3'
// https://jarcasting.com/artifacts/org.webjars.npm/adaptive-bezier-curve/
implementation ("org.webjars.npm:adaptive-bezier-curve:1.0.3")
'org.webjars.npm:adaptive-bezier-curve:jar:1.0.3'
<dependency org="org.webjars.npm" name="adaptive-bezier-curve" rev="1.0.3">
  <artifact name="adaptive-bezier-curve" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='adaptive-bezier-curve', version='1.0.3')
)
libraryDependencies += "org.webjars.npm" % "adaptive-bezier-curve" % "1.0.3"
[org.webjars.npm/adaptive-bezier-curve "1.0.3"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

adaptive-bezier-curve

stable

Builds a bezier curve that is adaptive; that is to say, it has more points along curved corners, and less points along straight lines. This can be used to produce scalable curves that are consistently smooth, while using a small number of steps. Based on AntiGrain.

Also see adaptive-quadratic-curve.

var bezier = require('adaptive-bezier-curve')

var start = [20, 20],
    c1 = [100, 159],
    c2 = [50, 200],
    end = [200, 20],
    scale = 2

var points = bezier(start, c1, c2, end, scale)

//returns a list of 2d points: [ [x,y], [x,y], [x,y] ... ]

See demo/index.js for an example with HTML5 canvas.

img

Usage

NPM

bezier(start, c1, c2, end[, scale, points])

Returns an adaptive bezier curve for the given four control points. You can specify a scale to produce better smoothing for scaled contexts, otherwise it defaults to 1.0.

If you specify a points array, the new points will be pushed onto that array (useful for building paths). If you don't specify points, a new array will be used.

License

The AntiGrain 2.4 code is licensed under BSD-3-Clause, see LICENSE.md for details.

Versions

Version
1.0.3