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
NameDescription

opts

Geometry2dOptions

Properties





area

Public readonly property

Signature
get area(): number

bounds

Public readonly property

Signature
get bounds(): Box
References

Box


center

Public readonly property

Signature
get center(): Vec
References

Vec


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

Vec


vertices

Public readonly property

Signature
get vertices(): Vec[]
References

Vec


Methods

distanceToLineSegment()

Public method

Signature
distanceToLineSegment(A: Vec, B: Vec): number
Parameters
NameDescription

A

Vec

B

Vec
Returns
number
References

Vec


distanceToPoint()

Public method

Signature
distanceToPoint(point: Vec, hitInside?: boolean): number
Parameters
NameDescription

point

Vec

hitInside

boolean
Returns
number
References

Vec


getArea()

Public method

Signature
getArea(): number

getBounds()

Public method

Signature
getBounds(): Box
References

Box


getVertices()

Public method

Signature
abstract getVertices(): Vec[]
References

Vec


hitTestLineSegment()

Public method

Signature
hitTestLineSegment(A: Vec, B: Vec, distance?: number): boolean
Parameters
NameDescription

A

Vec

B

Vec

distance

number
Returns
boolean
References

Vec


hitTestPoint()

Public method

Signature
hitTestPoint(point: Vec, margin?: number, hitInside?: boolean): boolean
Parameters
NameDescription

point

Vec

margin

number

hitInside

boolean
Returns
boolean
References

Vec


isPointInBounds()

Public method

Signature
isPointInBounds(point: Vec, margin?: number): boolean
Parameters
NameDescription

point

Vec

margin

number
Returns
boolean
References

Vec


nearestPoint()

Public method

Signature
abstract nearestPoint(point: Vec): Vec
Parameters
NameDescription

point

Vec
Returns
Vec
References

Vec


nearestPointOnLineSegment()

Public method

Signature
nearestPointOnLineSegment(A: Vec, B: Vec): Vec
Parameters
NameDescription

A

Vec

B

Vec
Returns
Vec
References

Vec


toSimpleSvgPath()

Public method

Signature
toSimpleSvgPath(): string

GapsSnapLinegetArrowTerminalsInArrowSpace