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