Table of contents

Extends Polygon2d.

class Rectangle2d extends Polygon2d {}

Constructor

Constructs a new instance of the Rectangle2d class

Parameters
NameDescription

config

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

Properties


area

from Geometry2d
get area(): number

bounds

from Geometry2d
get bounds(): Box

center

from Geometry2d
get center(): Vec

debugColor

from Geometry2d
debugColor?: string

h

h: number

ignore

from Geometry2d
ignore?: boolean

isClosed

from Geometry2d
isClosed: boolean

isFilled

from Geometry2d
isFilled: boolean

isLabel

from Geometry2d
isLabel: boolean

length

from Geometry2d
get length(): number

points

from Polyline2d
points: Vec[]

segments

from Polyline2d
get segments(): Edge2d[]

vertices

from Geometry2d
get vertices(): Vec[]

w

w: number

x

x: number

y

y: number

Methods

distanceToLineSegment()

from Geometry2d
distanceToLineSegment(A: Vec, B: Vec): number
Parameters
NameDescription

A

Vec

B

Vec
Returns
number

distanceToPoint()

from Geometry2d
distanceToPoint(point: Vec, hitInside?: boolean): number
Parameters
NameDescription

point

Vec

hitInside

boolean
Returns
number

getArea()

from Geometry2d
getArea(): number

getBounds()

getBounds(): Box

getLength()

from Polyline2d
getLength(): number

getSvgPathData()

getSvgPathData(): string

getVertices()

from Polyline2d
getVertices(): Vec[]

hitTestLineSegment()

from Polyline2d
hitTestLineSegment(A: Vec, B: Vec, distance?: number): boolean
Parameters
NameDescription

A

Vec

B

Vec

distance

number
Returns
boolean

hitTestPoint()

from Geometry2d
hitTestPoint(point: Vec, margin?: number, hitInside?: boolean): boolean
Parameters
NameDescription

point

Vec

margin

number

hitInside

boolean
Returns
boolean

isPointInBounds()

from Geometry2d
isPointInBounds(point: Vec, margin?: number): boolean
Parameters
NameDescription

point

Vec

margin

number
Returns
boolean

nearestPoint()

from Polyline2d
nearestPoint(A: Vec): Vec
Parameters
NameDescription

A

Vec
Returns
Vec

nearestPointOnLineSegment()

from Geometry2d
nearestPointOnLineSegment(A: Vec, B: Vec): Vec
Parameters
NameDescription

A

Vec

B

Vec
Returns
Vec

toSimpleSvgPath()

from Geometry2d
toSimpleSvgPath(): string

ReadonlySharedStyleMapScribbleManager