Table of contents

Extends Geometry2d.

class Circle2d extends Geometry2d {}

Constructor

Constructs a new instance of the Circle2d class

Parameters

NameDescription

config

Omit<Geometry2dOptions, 'isClosed'> & {
  isFilled: boolean
  radius: number
  x?: number
  y?: number
}

Properties


area

readonly
get area(): number

bounds

readonly
get bounds(): Box

center

readonly
get center(): Vec

config

config: Omit<Geometry2dOptions, 'isClosed'> & {
  isFilled: boolean
  radius: number
  x?: number
  y?: number
}

debugColor

optional
debugColor?: string

ignore

optional
ignore?: boolean

isClosed

isClosed: boolean

isFilled

isFilled: boolean

isInternal

isInternal: boolean

isLabel

isLabel: boolean

length

readonly
get length(): number

radius

radius: number

vertices

readonly
get vertices(): Vec[]

x

x: number

y

y: number

Methods

distanceToLineSegment()

distanceToLineSegment(
  A: VecLike,
  B: VecLike,
  filters?: Geometry2dFilters
): number

Parameters

NameDescription

A

B

filters

Returns

number

distanceToPoint()

distanceToPoint(
  point: VecLike,
  hitInside?: boolean,
  filters?: Geometry2dFilters
): number

Parameters

NameDescription

point

hitInside

boolean

filters

Returns

number

getArea()

getArea(): number

getBounds()

getBounds(): Box

getLength()

getLength(_filters?: Geometry2dFilters): number

Parameters

NameDescription

_filters

Returns

number

getSvgPathData()

getSvgPathData(): string

getVertices()

getVertices(): Vec[]

hitTestLineSegment()

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

Parameters

NameDescription

A

B

distance

number

Returns

boolean

hitTestPoint()

hitTestPoint(
  point: VecLike,
  margin?: number,
  hitInside?: boolean,
  _filters?: Geometry2dFilters
): boolean

Parameters

NameDescription

point

margin

number

hitInside

boolean

_filters

Returns

boolean

interpolateAlongEdge()

Find a point along the edge of the geometry that is a fraction t along the entire way round.

interpolateAlongEdge(t: number, _filters?: Geometry2dFilters): Vec

Parameters

NameDescription

t

number

_filters

Returns


intersectCircle()

intersectCircle(
  center: VecLike,
  radius: number,
  _filters?: Geometry2dFilters
): VecLike[]

Parameters

NameDescription

center

radius

number

_filters

Returns


intersectLineSegment()

intersectLineSegment(
  A: VecLike,
  B: VecLike,
  _filters?: Geometry2dFilters
): VecLike[]

Parameters

NameDescription

A

B

_filters

Returns


intersectPolygon()

intersectPolygon(polygon: VecLike[], _filters?: Geometry2dFilters): VecLike[]

Parameters

NameDescription

polygon

_filters

Returns


intersectPolyline()

intersectPolyline(
  polyline: VecLike[],
  _filters?: Geometry2dFilters
): VecLike[]

Parameters

NameDescription

polyline

_filters

Returns


isExcludedByFilter()

isExcludedByFilter(filters?: Geometry2dFilters): boolean

Parameters

NameDescription

filters

Returns

boolean

isPointInBounds()

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

Parameters

NameDescription

point

margin

number

Returns

boolean

nearestPoint()

nearestPoint(point: VecLike): Vec

Parameters

NameDescription

point

Returns


nearestPointOnLineSegment()

Deprecated: Iterate the vertices instead.

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

Parameters

NameDescription

A

B

Returns


toSimpleSvgPath()

toSimpleSvgPath(): string

transform()

transform(
  transform: MatModel,
  opts?: TransformedGeometry2dOptions
): Geometry2d

Parameters

NameDescription

transform

opts

Returns


uninterpolateAlongEdge()

Take point, find the closest point to it on the edge of the geometry, and return how far along the edge it is as a fraction of the total length.

uninterpolateAlongEdge(point: VecLike, _filters?: Geometry2dFilters): number

Parameters

NameDescription

point

_filters

Returns

number

Prev
Box
Next
ClickManager

We use cookies on this website.
Learn more in our Cookie Policy.