CubicBezier2d

See source code
Table of contents

Extends Polyline2d.

class CubicBezier2d extends Polyline2d {}

Constructor

Constructs a new instance of the CubicBezier2d class

Parameters

NameDescription

config

Omit<
  Geometry2dOptions,
  'isClosed' | 'isFilled'
> & {
  cp1: Vec
  cp2: Vec
  end: Vec
  start: Vec
}

Properties


a

a: Vec

area

readonly
get area(): number

b

b: Vec

bounds

readonly
get bounds(): Box

c

c: Vec

center

readonly
get center(): Vec

d

d: Vec

debugColor

optional
debugColor?: string

ignore

optional
ignore?: boolean

isClosed

isClosed: boolean

isFilled

isFilled: boolean

isLabel

isLabel: boolean

length

readonly
get length(): number

points

points: Vec[]

segments

readonly
get segments(): Edge2d[]

vertices

readonly
get vertices(): Vec[]

Methods

GetAtT()

static
static GetAtT(segment: CubicBezier2d, t: number): Vec

Parameters

NameDescription

segment

t

number

Returns


distanceToLineSegment()

distanceToLineSegment(A: Vec, B: Vec): number

Parameters

NameDescription

A

B

Returns

number

distanceToPoint()

distanceToPoint(point: Vec, hitInside?: boolean): number

Parameters

NameDescription

point

hitInside

boolean

Returns

number

getArea()

getArea(): number

getBounds()

getBounds(): Box

getLength()

getLength(precision?: number): number

Parameters

NameDescription

precision

number

Returns

number

getSvgPathData()

getSvgPathData(first?: boolean): string

Parameters

NameDescription

first

boolean

Returns

string

getVertices()

getVertices(): Vec[]

hitTestLineSegment()

hitTestLineSegment(A: Vec, B: Vec, distance?: number): boolean

Parameters

NameDescription

A

B

distance

number

Returns

boolean

hitTestPoint()

hitTestPoint(point: Vec, margin?: number, hitInside?: boolean): boolean

Parameters

NameDescription

point

margin

number

hitInside

boolean

Returns

boolean

isPointInBounds()

isPointInBounds(point: Vec, margin?: number): boolean

Parameters

NameDescription

point

margin

number

Returns

boolean

midPoint()

midPoint(): Vec

nearestPoint()

nearestPoint(A: Vec): Vec

Parameters

NameDescription

A

Returns


nearestPointOnLineSegment()

nearestPointOnLineSegment(A: Vec, B: Vec): Vec

Parameters

NameDescription

A

B

Returns


toSimpleSvgPath()

toSimpleSvgPath(): string

Prev
ClickManager
Next
CubicSpline2d