Skip to content

Class: Bezier2D

2D Bezier Curve

Constructors

Accessors

Methods

Constructors

constructor

new Bezier2D(vec2Ds?): Bezier2D

instance bezier class

Parameters

NameTypeDefault value
vec2DsVector2[][]

Returns

Bezier2D

Defined in

src/math/Bezier2D.ts:16

Accessors

points

get points(): Vector2[]

get all bezier 2d points

Returns

Vector2[]

Defined in

src/math/Bezier2D.ts:24

set points(value): void

set bezier 2d point[x,y] list must great 4

Parameters

NameType
valueVector2[]

Returns

void

Defined in

src/math/Bezier2D.ts:31

Methods

getValue

getValue(v): Vector2

get point2d at curve

Parameters

NameTypeDescription
vnumber0.0 ~ 1.0

Returns

Vector2

return point2D at curve

Defined in

src/math/Bezier2D.ts:40


createBezierPoints

createBezierPoints(anchorpoints, pointsAmount): Bezier2D

caclute bezier curve points at line [ 0.0 , 1.0 ]

Parameters

NameTypeDescription
anchorpointsVector2[]bezier anchor
pointsAmountnumberpoint count

Returns

Bezier2D

get a bezier curve [Bezier2D]

Defined in

src/math/Bezier2D.ts:64

Released under the MIT License