Polygon2d
Table of contents
Extends Polyline2d.
class Polygon2d extends Polyline2d {}
Constructs a new instance of the Polygon2d class
Parameters
| Name | Description |
|---|---|
| |
Properties
from
Geometry2dget area(): number
from
Geometry2dget bounds(): Box
from
Geometry2dget center(): Vec
from
Geometry2ddebugColor?: string
from
Geometry2dignore?: boolean
from
Geometry2disClosed: boolean
from
Geometry2disFilled: boolean
from
Geometry2disLabel: boolean
from
Geometry2dget length(): number
from
Polyline2dpoints: Vec[]
from
Polyline2dget segments(): Edge2d[]
from
Geometry2dget vertices(): Vec[]
Methods
from
Geometry2ddistanceToLineSegment(A: Vec, B: Vec): number
Parameters
Returns
number
from
Geometry2ddistanceToPoint(point: Vec, hitInside?: boolean): number
Parameters
| Name | Description |
|---|---|
| |
| |
Returns
number
from
Geometry2dgetArea(): number
from
Geometry2dgetBounds(): Box
from
Polyline2dgetLength(): number
from
Polyline2dgetSvgPathData(): string
from
Polyline2dgetVertices(): Vec[]
from
Polyline2dhitTestLineSegment(A: Vec, B: Vec, distance?: number): boolean
Parameters
Returns
boolean
from
Geometry2dhitTestPoint(point: Vec, margin?: number, hitInside?: boolean): boolean
Parameters
| Name | Description |
|---|---|
| |
| |
| |
Returns
boolean
from
Geometry2disPointInBounds(point: Vec, margin?: number): boolean
Parameters
| Name | Description |
|---|---|
| |
| |
Returns
boolean
from
Polyline2dnearestPoint(A: Vec): Vec
Parameters
| Name | Description |
|---|---|
| |
Returns
Vec
from
Geometry2dnearestPointOnLineSegment(A: Vec, B: Vec): Vec
Parameters
Returns
Vec
from
Geometry2dtoSimpleSvgPath(): string

