Class HobbyPath

Classdesc

A HobbyCurve/HobbyPath calculation class: compute a set of optimal cubic Bézier curves from a sequence of vertices.

CubicBezierCurve

Vertex

Properties

vertices: Vertex[]

vertices

HobbyPath

Instance

utils: {
normalize: ((vec) => Vertex);
rho: ((a, b) => number);
rotate: ((vert, sin, cos) => Vertex);
rotateAngle: ((vert, alpha) => Vertex);
sherman: ((a, b, c, d, s, t) => number[]);
thomas: ((a, b, c, d) => number[]);
} = ...

Type declaration

• normalize: ((vec) => Vertex)
• (vec): Vertex

Returns Vertex

• rho: ((a, b) => number)
• (a, b): number
• Parameters

• a: number
• b: number

Returns number

• rotate: ((vert, sin, cos) => Vertex)
• (vert, sin, cos): Vertex
• Parameters

• vert: Vertex
• sin: number
• cos: number

Returns Vertex

• rotateAngle: ((vert, alpha) => Vertex)
• (vert, alpha): Vertex

Returns Vertex

• sherman: ((a, b, c, d, s, t) => number[])
• (a, b, c, d, s, t): number[]
• Parameters

• a: number[]
• b: number[]
• c: number[]
• d: number[]
• s: number
• t: number

Returns number[]

• thomas: ((a, b, c, d) => number[])
• (a, b, c, d): number[]
• Parameters

• a: number[]
• b: number[]
• c: number[]
• d: number[]

Methods

• Generate a sequence of cubic Bézier curves from the point set.

Parameters

• `Optional` circular: boolean

Specify if the path should be closed.

• `Optional` omega: number

(default=0) An optional tension parameter.

Array

Name

generateCurve

HobbyPath

Instance

• Computes the control point coordinates for a Hobby curve through the points given.

Parameters

• `Optional` circular: boolean

If true, then the path will be closed.

• `Optional` omega: number

The 'curl' or the path.

Returns IControlPoints

An object with two members: startControlPoints and endControlPoints (Array).

Name

hobbyControls

HobbyPath