Geometry2d
Table of contents
abstract class Geometry2d {}
Constructs a new instance of the Geometry2d
class
Parameters
Name | Description |
---|---|
|
|
Properties
get area(): number
get bounds(): Box
get center(): Vec
debugColor?: string
ignore?: boolean
isClosed: boolean
isFilled: boolean
isLabel: boolean
get length(): number
get vertices(): Vec[]
Methods
distanceToLineSegment(A: Vec, B: Vec): number
Parameters
Returns
number
distanceToPoint(point: Vec, hitInside?: boolean): number
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
number
getArea(): number
getBounds(): Box
getLength(): number
abstract getSvgPathData(first: boolean): string
Parameters
Name | Description |
---|---|
|
|
Returns
string
abstract getVertices(): Vec[]
hitTestLineSegment(A: Vec, B: Vec, distance?: number): boolean
Parameters
Returns
boolean
hitTestPoint(point: Vec, margin?: number, hitInside?: boolean): boolean
Parameters
Name | Description |
---|---|
|
|
|
|
|
|
Returns
boolean
isPointInBounds(point: Vec, margin?: number): boolean
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
boolean
abstract nearestPoint(point: Vec): Vec
Parameters
Name | Description |
---|---|
|
|
Returns
Vec
nearestPointOnLineSegment(A: Vec, B: Vec): Vec
Parameters
Returns
Vec
toSimpleSvgPath(): string