Geometry2d
Table of contents
Public class
Signature
abstract class Geometry2d {}
Source
packages/editor/src/lib/primitives/geometry/Geometry2d.ts
Constructor
Public constructor
Constructs a new instance of the Geometry2d
class
Parameters
Name | Description |
---|---|
|
|
Properties
area
Public readonly property
Signature
get area(): number
bounds
Public readonly property
Signature
get bounds(): Box
References
center
Public readonly property
Signature
get center(): Vec
References
debugColor
Public property
Signature
debugColor?: string
ignore
Public property
Signature
ignore?: boolean
isClosed
Public property
Signature
isClosed: boolean
isFilled
Public property
Signature
isFilled: boolean
isLabel
Public property
Signature
isLabel: boolean
isSnappable
Public property
Signature
isSnappable: boolean
snapPoints
Public readonly property
Signature
get snapPoints(): Vec[]
References
vertices
Public readonly property
Signature
get vertices(): Vec[]
References
Methods
distanceToLineSegment()
Public method
Signature
distanceToLineSegment(A: Vec, B: Vec): number
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
number
References
distanceToPoint()
Public method
Signature
distanceToPoint(point: Vec, hitInside?: boolean): number
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
number
References
getArea()
Public method
Signature
getArea(): number
getBounds()
Public method
Signature
getBounds(): Box
References
getVertices()
Public method
Signature
abstract getVertices(): Vec[]
References
hitTestLineSegment()
Public method
Signature
hitTestLineSegment(A: Vec, B: Vec, distance?: number): boolean
Parameters
Name | Description |
---|---|
|
|
|
|
|
|
Returns
boolean
References
hitTestPoint()
Public method
Signature
hitTestPoint(point: Vec, margin?: number, hitInside?: boolean): boolean
Parameters
Name | Description |
---|---|
|
|
|
|
|
|
Returns
boolean
References
isPointInBounds()
Public method
Signature
isPointInBounds(point: Vec, margin?: number): boolean
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
boolean
References
nearestPoint()
Public method
Signature
abstract nearestPoint(point: Vec): Vec
Parameters
Name | Description |
---|---|
|
|
Returns
Vec
References
nearestPointOnLineSegment()
Public method
Signature
nearestPointOnLineSegment(A: Vec, B: Vec): Vec
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
Vec
References
toSimpleSvgPath()
Public method
Signature
toSimpleSvgPath(): string