Class CurvePath

An extensible curve object which contains methods for interpolation class Curve<T extends Vector>

Hierarchy

Index

Constructor methods

Properties

Methods

Constructor methods

constructor(): CurvePath

Returns

CurvePath

Properties

public autoClose: boolean

public bends: Path[]

public curves: Curve[]

public needsUpdate: boolean

Methods

public add(curve: Curve)

Parameters

public addWrapPath(bendpath: Path)

Parameters

public checkConnection(): boolean

Returns

boolean

public closePath()

public createGeometry(points: Vector2[]): Geometry

Parameters

Returns

Geometry

public createPointsGeometry(divisions: number): Geometry

Parameters

  • divisions: number

Returns

Geometry

public createSpacedPointsGeometry(divisions: number): Geometry

Parameters

  • divisions: number

Returns

Geometry

public getBoundingBox(): BoundingBox

Returns

BoundingBox

public getCurveLengths(): number

Returns

number

public getLength(): number

Get total curve arc length

Returns

number

public getLengths(divisions?: number): Array<number>

Get list of cumulative segment lengths

Parameters

  • divisions?: number optional

Returns

Array<number>

public getPoint(t: number): Vector

Returns a vector for point t of the curve where t is between 0 and 1 getPoint(t: number): T;

Parameters

  • t: number

Returns

Vector

public getPointAt(u: number): Vector

Returns a vector for point at relative position in curve according to arc length getPointAt(u: number): T;

Parameters

  • u: number

Returns

Vector

public getPoints(divisions?: number): Vector[]

Get sequence of points using getPoint( t ) getPoints(divisions?: number): T[];

Parameters

  • divisions?: number optional

Returns

Vector[]

public getSpacedPoints(divisions?: number): Vector[]

Get sequence of equi-spaced points using getPointAt( u ) getSpacedPoints(divisions?: number): T[];

Parameters

  • divisions?: number optional

Returns

Vector[]

public getTangent(t: number): Vector

Returns a unit vector tangent at t. If the subclassed curve do not implement its tangent derivation, 2 points a small delta apart will be used to find its gradient which seems to give a reasonable approximation getTangent(t: number): T;

Parameters

  • t: number

Returns

Vector

public getTangentAt(u: number): Vector

Returns tangent at equidistance point u on the curve getTangentAt(u: number): T;

Parameters

  • u: number

Returns

Vector

public getTransformedPoints(segments: number, bends?: Path): Vector2[]

Parameters

  • segments: number
  • bends?: Path optional

Returns

Vector2[]

public getTransformedSpacedPoints(segments: number, bends?: Path[]): Vector2[]

Parameters

  • segments: number
  • bends?: Path[] optional

Returns

Vector2[]

public getUtoTmapping(u: number, distance: number): number

Given u ( 0 .. 1 ), get a t to find p. This gives you points which are equi distance

Parameters

  • u: number
  • distance: number

Returns

number

public getWrapPoints(oldPts: Vector2[], path: Path): Vector2[]

Parameters

Returns

Vector2[]

public updateArcLengths()

Update the cumlative segment distance cache