Rectangle2d
Table of contents
Extends Polygon2d
.
class Rectangle2d extends Polygon2d {}
Constructs a new instance of the Rectangle2d
class
Parameters
Name | Description |
---|---|
|
|
Properties
from
Geometry2d
get area(): number
from
Geometry2d
get bounds(): Box
from
Geometry2d
get center(): Vec
from
Geometry2d
debugColor?: string
h: number
from
Geometry2d
ignore?: boolean
from
Geometry2d
isClosed: boolean
from
Geometry2d
isFilled: boolean
from
Geometry2d
isLabel: boolean
from
Geometry2d
get length(): number
from
Polyline2d
points: Vec[]
from
Polyline2d
get segments(): Edge2d[]
from
Geometry2d
get vertices(): Vec[]
w: number
x: number
y: number
Methods
from
Geometry2d
distanceToLineSegment(A: Vec, B: Vec): number
Parameters
Returns
number
from
Geometry2d
distanceToPoint(point: Vec, hitInside?: boolean): number
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
number
from
Geometry2d
getArea(): number
getBounds(): Box
from
Polyline2d
getLength(): number
getSvgPathData(): string
from
Polyline2d
getVertices(): Vec[]
from
Polyline2d
hitTestLineSegment(A: Vec, B: Vec, distance?: number): boolean
Parameters
Returns
boolean
from
Geometry2d
hitTestPoint(point: Vec, margin?: number, hitInside?: boolean): boolean
Parameters
Name | Description |
---|---|
|
|
|
|
|
|
Returns
boolean
from
Geometry2d
isPointInBounds(point: Vec, margin?: number): boolean
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
boolean
from
Polyline2d
nearestPoint(A: Vec): Vec
Parameters
Name | Description |
---|---|
|
|
Returns
Vec
from
Geometry2d
nearestPointOnLineSegment(A: Vec, B: Vec): Vec
Parameters
Returns
Vec
from
Geometry2d
toSimpleSvgPath(): string