Table of contents

Extends Geometry2d.

class Stadium2d extends Geometry2d {}

Constructor

Constructs a new instance of the Stadium2d class

Parameters

NameDescription

config

Omit<Geometry2dOptions, 'isClosed'> & {
  height: number
  width: number
}

Properties

a

a: Arc2d

area

readonly
get area(): number

b

b: Edge2d

bounds

readonly
get bounds(): Box

c

c: Arc2d

center

readonly
get center(): Vec

config

config: Omit<Geometry2dOptions, 'isClosed'> & {
  height: number
  width: number
}

d

d: Edge2d

debugColor

optional
debugColor?: string

h

h: number

ignore

optional
ignore?: boolean

isClosed

isClosed: boolean

isFilled

isFilled: boolean

isLabel

isLabel: boolean

length

readonly
get length(): number

vertices

readonly
get vertices(): Vec[]

w

w: number

Methods

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(): number

getSvgPathData()

getSvgPathData(): string

getVertices()

getVertices(): Vec[]

hitTestLineSegment()

hitTestLineSegment(A: Vec, B: Vec): boolean

Parameters

NameDescription

A

B

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

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
SnapManager
Next
StateNode