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(): Box2d
References

Box2d


center

Public readonly property

Signature
get center(): Vec2d
References

Vec2d


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(): Vec2d[]
References

Vec2d


vertices

Public readonly property

Signature
get vertices(): Vec2d[]
References

Vec2d


Methods

distanceToLineSegment()

Public method

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

A

Vec2d

B

Vec2d
Returns
number
References

Vec2d


distanceToPoint()

Public method

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

point

Vec2d

hitInside

boolean
Returns
number
References

Vec2d


getArea()

Public method

Signature
getArea(): number

getBounds()

Public method

Signature
getBounds(): Box2d
References

Box2d


getVertices()

Public method

Signature
abstract getVertices(): Vec2d[]
References

Vec2d


hitTestLineSegment()

Public method

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

A

Vec2d

B

Vec2d

distance

number
Returns
boolean
References

Vec2d


hitTestPoint()

Public method

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

point

Vec2d

margin

number

hitInside

boolean
Returns
boolean
References

Vec2d


isPointInBounds()

Public method

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

point

Vec2d

margin

number
Returns
boolean
References

Vec2d


nearestPoint()

Public method

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

point

Vec2d
Returns
Vec2d
References

Vec2d


nearestPointOnLineSegment()

Public method

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

A

Vec2d

B

Vec2d
Returns
Vec2d
References

Vec2d


toSimpleSvgPath()

Public method

Signature
toSimpleSvgPath(): string

GapsSnapLinegetArcLength